Skip to content

Commit

Permalink
recipient_for_emails: Fix type error
Browse files Browse the repository at this point in the history
Fixes
[
  File "/srv/zulip/zerver/lib/actions.py", line 605, in recipient_for_emails
    if not (normalized_emails & admin_realm_admin_emails or normalized_emails & settings.CROSS_REALM_BOT_EMAILS):
TypeError: unsupported operand type(s) for &: 'set' and 'list'

(imported from commit f39a95dad7b3207e9188fc03926cd116061ef3f3)
  • Loading branch information
andersk committed Aug 21, 2015
1 parent 36c6f1e commit 5c6cd40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zerver/lib/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def recipient_for_emails(emails, not_forged_mirror_message,
if len(realm_domains) == 2:
# I'm assuming that cross-realm PMs with the "admin realm" are rare, and therefore can be slower
admin_realm = Realm.objects.get(domain=settings.ADMIN_DOMAIN)
admin_realm_admin_emails = [u.email for u in admin_realm.get_admin_users()]
admin_realm_admin_emails = {u.email for u in admin_realm.get_admin_users()}
# We allow settings.CROSS_REALM_BOT_EMAILS for the hardcoded emails for the feedback and notification bots
if not (normalized_emails & admin_realm_admin_emails or normalized_emails & settings.CROSS_REALM_BOT_EMAILS):
raise ValidationError("You can't send private messages outside of your organization.")
Expand Down

0 comments on commit 5c6cd40

Please sign in to comment.