Remove pointer_updater param as it is no longer used

(imported from commit 80cc4a6d4c24660087981b1132ca2ed44c86a424)
This commit is contained in:
Leo Franchi 2013-03-13 16:13:32 -04:00
parent 7c7822601f
commit 4a23959b11
3 changed files with 7 additions and 13 deletions

View File

@ -353,7 +353,6 @@ class PointerTest(AuthedTestCase):
self.assertEqual(self.get_user_profile(email).pointer, -1)
result = self.client.post("/api/v1/update_pointer", {"email": email,
"api-key": api_key,
"client_id": "blah",
"pointer": 1})
self.assert_json_success(result)
self.assertEqual(self.get_user_profile(email).pointer, 1)

View File

@ -228,7 +228,7 @@ def get_user_pointer(user_profile_id):
def set_user_pointer(user_profile_id, pointer):
user_pointers[user_profile_id] = pointer
def update_pointer(user_profile_id, new_pointer, pointer_updater):
def update_pointer(user_profile_id, new_pointer):
set_user_pointer(user_profile_id, new_pointer)
callbacks_table.call(user_profile_id, Callbacks.TYPE_POINTER_UPDATE,
new_pointer=new_pointer,
@ -253,9 +253,8 @@ def notify_new_message(request):
def notify_pointer_update(request):
user_profile_id = int(request.POST['user'])
new_pointer = int(request.POST['new_pointer'])
pointer_updater = request.POST['pointer_updater']
update_pointer(user_profile_id, new_pointer, pointer_updater)
update_pointer(user_profile_id, new_pointer)
return json_success()

View File

@ -441,23 +441,20 @@ def home(request):
context_instance=RequestContext(request))
@authenticated_api_view
@has_request_variables
def api_update_pointer(request, user_profile, updater=POST('client_id')):
return update_pointer_backend(request, user_profile, updater)
def api_update_pointer(request, user_profile):
return update_pointer_backend(request, user_profile)
@authenticated_json_post_view
def json_update_pointer(request, user_profile):
return update_pointer_backend(request, user_profile,
request.session.session_key)
return update_pointer_backend(request, user_profile)
@has_request_variables
def update_pointer_backend(request, user_profile, updater,
def update_pointer_backend(request, user_profile,
pointer=POST(converter=to_non_negative_int)):
if pointer <= user_profile.pointer:
return json_success()
user_profile.pointer = pointer
user_profile.last_pointer_updater = updater
user_profile.save()
if request._client.name.lower() in ['android', 'iphone']:
@ -474,8 +471,7 @@ def update_pointer_backend(request, user_profile, updater,
requests.post(settings.TORNADO_SERVER + '/notify_pointer_update', data=dict(
secret = settings.SHARED_SECRET,
user = user_profile.id,
new_pointer = pointer,
pointer_updater = updater))
new_pointer = pointer))
return json_success()