From 495671cca09d5a029ea546f28c78f45115dedb38 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Tue, 19 Jul 2022 12:08:19 -0700 Subject: [PATCH] confirmation: Rename confusing activate_object parameter. --- confirmation/models.py | 4 ++-- zerver/views/registration.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/confirmation/models.py b/confirmation/models.py index fe93daaf5c..f42f396c6a 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 278d3246b4..f577c85ea9 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 [