mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Specify requests.post data as a dict
These were lists of pairs because we were going to repeat keys, but that didn't work anyway. (imported from commit 687b3f7b8a2821d057719c725f1f39db3992ae5c)
This commit is contained in:
@@ -493,11 +493,11 @@ def do_send_message(message, no_log=False):
|
||||
# TODO: Reduce duplication in what we send.
|
||||
rendered = { 'text/html': message.to_dict(apply_markdown=True),
|
||||
'text/x-markdown': message.to_dict(apply_markdown=False) }
|
||||
requests.post(settings.TORNADO_SERVER + '/notify_new_message', data=[
|
||||
('secret', settings.SHARED_SECRET),
|
||||
('message', message.id),
|
||||
('rendered', simplejson.dumps(rendered)),
|
||||
('users', ','.join(str(user.id) for user in recipients))])
|
||||
requests.post(settings.TORNADO_SERVER + '/notify_new_message', data=dict(
|
||||
secret = settings.SHARED_SECRET,
|
||||
message = message.id,
|
||||
rendered = simplejson.dumps(rendered),
|
||||
users = ','.join(str(user.id) for user in recipients)))
|
||||
|
||||
class Subscription(models.Model):
|
||||
user_profile = models.ForeignKey(UserProfile)
|
||||
|
||||
@@ -192,11 +192,11 @@ def update_pointer_backend(request, user_profile, updater, pointer=POST(converte
|
||||
user_profile.save()
|
||||
|
||||
if settings.TORNADO_SERVER:
|
||||
requests.post(settings.TORNADO_SERVER + '/notify_pointer_update', data=[
|
||||
('secret', settings.SHARED_SECRET),
|
||||
('user', user_profile.user.id),
|
||||
('new_pointer', pointer),
|
||||
('pointer_updater', updater)])
|
||||
requests.post(settings.TORNADO_SERVER + '/notify_pointer_update', data=dict(
|
||||
secret = settings.SHARED_SECRET,
|
||||
user = user_profile.user.id,
|
||||
new_pointer = pointer,
|
||||
pointer_updater = updater))
|
||||
|
||||
return json_success()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user