urls: Move the json/fetch_api_key endpoint to be an API-style route.

This commit is contained in:
Alena Volkova
2018-01-05 15:30:55 -05:00
committed by showell
parent 7c22045158
commit 9d1063d362
3 changed files with 6 additions and 3 deletions

View File

@@ -731,7 +731,6 @@ def api_get_server_settings(request: HttpRequest) -> HttpResponse:
result[settings_item] = context[settings_item]
return json_success(result)
@authenticated_json_post_view
@has_request_variables
def json_fetch_api_key(request: HttpRequest, user_profile: UserProfile,
password: str=REQ(default='')) -> HttpResponse:

View File

@@ -16,6 +16,4 @@ legacy_urls = [
# any more to find out about subscriptions, since they are already
# pushed to us via the event system.
url(r'^json/subscriptions/exists$', zerver.views.streams.json_stream_exists),
url(r'^json/fetch_api_key$', zerver.views.auth.json_fetch_api_key),
]

View File

@@ -517,6 +517,12 @@ for incoming_webhook in WEBHOOK_INTEGRATIONS:
urls.append(url(r'^api/v1/external/github', github_dispatcher.api_github_webhook_dispatch))
# Desktop-specific authentication URLs
urls += [
url(r'^json/fetch_api_key$', rest_dispatch,
{'POST': 'zerver.views.auth.json_fetch_api_key'}),
]
# Mobile-specific authentication URLs
urls += [
# This json format view used by the mobile apps lists which