Remove legacy /api/v1/update_pointer endpoint.

(imported from commit 4e2d111cf00ab2064291b282795c4b89835d1c17)
This commit is contained in:
Tim Abbott
2013-12-11 14:45:46 -05:00
parent 0c79465950
commit 0a7c6ac261
3 changed files with 2 additions and 10 deletions

View File

@@ -507,7 +507,6 @@ class PublicURLTest(TestCase):
"/api/v1/users/me/subscriptions", "/api/v1/users/me/subscriptions",
], ],
400: ["/api/v1/send_message", 400: ["/api/v1/send_message",
"/api/v1/update_pointer",
"/api/v1/external/github", "/api/v1/external/github",
"/api/v1/fetch_api_key", "/api/v1/fetch_api_key",
], ],
@@ -1037,12 +1036,10 @@ class PointerTest(AuthedTestCase):
Same as above, but for the API view Same as above, but for the API view
""" """
email = "hamlet@zulip.com" email = "hamlet@zulip.com"
api_key = self.get_api_key(email)
self.assertEqual(get_user_profile_by_email(email).pointer, -1) self.assertEqual(get_user_profile_by_email(email).pointer, -1)
msg_id = self.send_message("othello@zulip.com", "Verona", Recipient.STREAM) msg_id = self.send_message("othello@zulip.com", "Verona", Recipient.STREAM)
result = self.client.post("/api/v1/update_pointer", {"email": email, result = self.client_put("/api/v1/users/me/pointer", {"pointer": msg_id},
"api-key": api_key, **self.api_auth(email))
"pointer": msg_id})
self.assert_json_success(result) self.assert_json_success(result)
self.assertEqual(get_user_profile_by_email(email).pointer, msg_id) self.assertEqual(get_user_profile_by_email(email).pointer, msg_id)

View File

@@ -858,10 +858,6 @@ def is_buggy_ua(agent):
def get_pointer_backend(request, user_profile): def get_pointer_backend(request, user_profile):
return json_success({'pointer': user_profile.pointer}) return json_success({'pointer': user_profile.pointer})
@authenticated_api_view
def api_update_pointer(request, user_profile):
return update_pointer_backend(request, user_profile)
@authenticated_json_post_view @authenticated_json_post_view
def json_update_pointer(request, user_profile): def json_update_pointer(request, user_profile):
return update_pointer_backend(request, user_profile) return update_pointer_backend(request, user_profile)

View File

@@ -141,7 +141,6 @@ urlpatterns += patterns('zerver.views',
# These are json format views used by the API. They require an API key. # These are json format views used by the API. They require an API key.
url(r'^api/v1/send_message$', 'api_send_message'), url(r'^api/v1/send_message$', 'api_send_message'),
url(r'^api/v1/update_pointer$', 'api_update_pointer'),
# This json format view used by the API accepts a username password/pair and returns an API key. # This json format view used by the API accepts a username password/pair and returns an API key.
url(r'^api/v1/fetch_api_key$', 'api_fetch_api_key'), url(r'^api/v1/fetch_api_key$', 'api_fetch_api_key'),