mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 03:53:50 +00:00 
			
		
		
		
	confirmation: Rename confusing activate_object parameter.
This commit is contained in:
		| @@ -50,7 +50,7 @@ ConfirmationObjT = Union[MultiuseInvite, PreregistrationUser, EmailChangeStatus, | |||||||
|  |  | ||||||
|  |  | ||||||
| def get_object_from_key( | 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: | ) -> ConfirmationObjT: | ||||||
|     # Confirmation keys used to be 40 characters |     # Confirmation keys used to be 40 characters | ||||||
|     if len(confirmation_key) not in (24, 40): |     if len(confirmation_key) not in (24, 40): | ||||||
| @@ -67,7 +67,7 @@ def get_object_from_key( | |||||||
|  |  | ||||||
|     obj = confirmation.content_object |     obj = confirmation.content_object | ||||||
|     assert obj is not None |     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.status = getattr(settings, "STATUS_USED", 1) | ||||||
|         obj.save(update_fields=["status"]) |         obj.save(update_fields=["status"]) | ||||||
|     return obj |     return obj | ||||||
|   | |||||||
| @@ -136,7 +136,7 @@ def check_prereg_key(request: HttpRequest, confirmation_key: str) -> Preregistra | |||||||
|         Confirmation.REALM_CREATION, |         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) |     assert isinstance(prereg_user, PreregistrationUser) | ||||||
|  |  | ||||||
|     if prereg_user.status in [ |     if prereg_user.status in [ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user