mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 02:48:00 +00:00
recipient_for_emails: Fix type error
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)
This commit is contained in:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user