mirror of https://github.com/zulip/zulip.git
Fix tracebacks sending messages nobody will receive.
(imported from commit afe3d7465f105015f7fa8247ab3cba7476b89fc2)
This commit is contained in:
parent
9c5136c8cc
commit
0fcf1db00a
|
@ -699,6 +699,12 @@ def notify_new_message(request, handler):
|
||||||
if not validate_notify(request, handler):
|
if not validate_notify(request, handler):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# If a message for some reason has no recipients (e.g. it is sent
|
||||||
|
# by a bot to a stream that nobody is subscribed to), just skip
|
||||||
|
# the message gracefully
|
||||||
|
if request.POST["users"] == "":
|
||||||
|
return
|
||||||
|
|
||||||
# FIXME: better query
|
# FIXME: better query
|
||||||
users = [UserProfile.objects.get(id=user)
|
users = [UserProfile.objects.get(id=user)
|
||||||
for user in request.POST['users'].split(',')]
|
for user in request.POST['users'].split(',')]
|
||||||
|
|
Loading…
Reference in New Issue