mypy: Use Python 3 type syntax in 'gitlab/view.py'.

This commit is contained in:
Xavier Cooney 2017-12-25 11:15:42 +00:00 committed by showell
parent 36b58ff6fc
commit 34aee15d63
1 changed files with 4 additions and 5 deletions

View File

@ -262,11 +262,10 @@ EVENT_FUNCTION_MAPPER = {
@api_key_only_webhook_view("Gitlab") @api_key_only_webhook_view("Gitlab")
@has_request_variables @has_request_variables
def api_gitlab_webhook(request, user_profile, def api_gitlab_webhook(request: HttpRequest, user_profile: UserProfile,
stream=REQ(default='gitlab'), stream: Text=REQ(default='gitlab'),
payload=REQ(argument_type='body'), payload: Dict[str, Any]=REQ(argument_type='body'),
branches=REQ(default=None)): branches: Optional[Text]=REQ(default=None)) -> HttpResponse:
# type: (HttpRequest, UserProfile, Text, Dict[str, Any], Optional[Text]) -> HttpResponse
event = get_event(request, payload, branches) event = get_event(request, payload, branches)
if event is not None: if event is not None:
body = get_body_based_on_event(event)(payload) body = get_body_based_on_event(event)(payload)