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.

actions: Change prereg_user.status in revoke_preregistration_users.

Mateusz Mandera22ac0f152e80
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 4cada48b831..2f7732573ef 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -463,8 +463,6 @@ def process_new_human_user(
mit_beta_user = realm.is_zephyr_mirror_realm
if prereg_user is not None:
- prereg_user.status = confirmation_settings.STATUS_ACTIVE
- prereg_user.save(update_fields=["status"])
streams = prereg_user.streams.all()
acting_user: Optional[UserProfile] = prereg_user.referred_by
else:
@@ -526,6 +524,10 @@ def revoke_preregistration_users(
if realm_creation and used_preregistration_user is None:
raise AssertionError("realm_creation should only happen with a PreregistrationUser")
+ if used_preregistration_user is not None:
+ used_preregistration_user.status = confirmation_settings.STATUS_ACTIVE
+ used_preregistration_user.save(update_fields=["status"])
+
# Mark any other PreregistrationUsers in the realm that are STATUS_ACTIVE as
# inactive so we can keep track of the PreregistrationUser we
# actually used for analytics.