mirror of https://github.com/zulip/zulip.git
confirmation: Rename confusing activate_object parameter.
This commit is contained in:
parent
fa7700df11
commit
495671cca0
|
@ -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
|
||||
|
|
|
@ -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 [
|
||||
|
|
Loading…
Reference in New Issue