Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

scim: Add None check for email_new_value.

Anders Kaseorg0bb0d3598b4c
diff --git a/zerver/lib/scim.py b/zerver/lib/scim.py
index 609002a3012..4a44a7e4611 100644
--- a/zerver/lib/scim.py
+++ b/zerver/lib/scim.py
@@ -264,7 +264,7 @@ class ZulipSCIMUser(SCIMUser):
self._password_set_to = None
self._role_new_value = None
- if email_new_value:
+ if email_new_value is not None:
try:
# Note that the validate_email check that usually
# appears adjacent to email_allowed_for_realm is
@@ -287,6 +287,7 @@ class ZulipSCIMUser(SCIMUser):
raise ConflictError("Email address already in use: " + str(e))
if self.is_new_user():
+ assert email_new_value is not None
assert full_name_new_value is not None
add_initial_stream_subscriptions = True
if (
@@ -316,7 +317,7 @@ class ZulipSCIMUser(SCIMUser):
if full_name_new_value:
check_change_full_name(self.obj, full_name_new_value, acting_user=None)
- if email_new_value:
+ if email_new_value is not None:
do_change_user_delivery_email(self.obj, email_new_value, acting_user=None)
if role_new_value is not None: