Skip to content

Commit

Permalink
create_user: Improve comment about prereg_user handling.
Browse files Browse the repository at this point in the history
The dangling comment was not very helpful and unclear about the pieces
of code it was referring to.

We expand the part about linking the prereg_user to the created user,
while the part about "revoking other preregistration users" is
redundant, because the relevant code block lower down already has
comments on it with better explanations.
  • Loading branch information
mateuszmandera authored and timabbott committed Jul 18, 2022
1 parent 6b451ce commit ff01777
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zerver/actions/create_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ def process_new_human_user(
),
)

# Revoke all preregistration users except prereg_user, and link prereg_user to
# the created user

# For the sake of tracking the history of UserProfiles,
# we want to tie the newly created user to the PreregistrationUser
# it was created from.
if prereg_user is not None:
prereg_user.status = confirmation_settings.STATUS_ACTIVE
prereg_user.created_user = user_profile
Expand Down

0 comments on commit ff01777

Please sign in to comment.