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.

confirmation: Rename confusing activate_object parameter.

Tim Abbott495671cca09d
diff --git a/confirmation/models.py b/confirmation/models.py
index fe93daaf5c7..f42f396c6a7 100644
--- a/confirmation/models.py
+++ b/confirmation/models.py
@@ -50,7 +50,7 @@ ConfirmationObjT = Union[MultiuseInvite, PreregistrationUser, EmailChangeStatus,
def get_object_from_key(
- confirmation_key: str, confirmation_types: List[int], activate_object: bool = True
+ confirmation_key: str, confirmation_types: List[int], mark_object_used: bool = True
) -> ConfirmationObjT:
# Confirmation keys used to be 40 characters
if len(confirmation_key) not in (24, 40):
@@ -67,7 +67,7 @@ def get_object_from_key(
obj = confirmation.content_object
assert obj is not None
- if activate_object and hasattr(obj, "status"):
+ if mark_object_used and hasattr(obj, "status"):
obj.status = getattr(settings, "STATUS_USED", 1)
obj.save(update_fields=["status"])
return obj
diff --git a/zerver/views/registration.py b/zerver/views/registration.py
index 278d3246b4e..f577c85ea9f 100644
--- a/zerver/views/registration.py
+++ b/zerver/views/registration.py
@@ -136,7 +136,7 @@ def check_prereg_key(request: HttpRequest, confirmation_key: str) -> Preregistra
Confirmation.REALM_CREATION,
]
- prereg_user = get_object_from_key(confirmation_key, confirmation_types, activate_object=False)
+ prereg_user = get_object_from_key(confirmation_key, confirmation_types, mark_object_used=False)
assert isinstance(prereg_user, PreregistrationUser)
if prereg_user.status in [