mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
do_send_message: use JSON for the user list instead of joining/splitting with commas
(imported from commit 85d94ca647d0e6707f4f96e2b7a7b330f76db9d9)
This commit is contained in:
parent
2907c3ca01
commit
f4898ea490
@ -535,7 +535,7 @@ def do_send_message(message, no_log=False):
|
||||
secret = settings.SHARED_SECRET,
|
||||
message = message.id,
|
||||
rendered = simplejson.dumps(rendered),
|
||||
users = ','.join(str(user.id) for user in recipients)))
|
||||
users = simplejson.dumps([str(user.id) for user in recipients])))
|
||||
|
||||
class Subscription(models.Model):
|
||||
user_profile = models.ForeignKey(UserProfile)
|
||||
|
||||
@ -678,7 +678,7 @@ def notify_new_message(request):
|
||||
|
||||
# FIXME: better query
|
||||
users = [UserProfile.objects.get(id=user)
|
||||
for user in request.POST['users'].split(',')]
|
||||
for user in simplejson.loads(request.POST['users'])]
|
||||
message = Message.objects.get(id=request.POST['message'])
|
||||
|
||||
# Cause message.to_dict() to return the dicts already rendered in the other process.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user