accounts: Allow user to change email visibility during first login.

We now allow users to change email address visibility setting
on the "Terms of service" page during first login. This page is
not shown for users creating account using normal registration
process, but is useful for imported users and users created
through API, LDAP, SCIM and management commands.
This commit is contained in:
Sahil Batra
2023-04-24 20:21:02 +05:30
committed by Tim Abbott
parent 7f01b3fb63
commit 007a51f277
7 changed files with 132 additions and 10 deletions

View File

@@ -250,7 +250,7 @@ def check_change_bot_full_name(
@transaction.atomic(durable=True)
def do_change_tos_version(user_profile: UserProfile, tos_version: str) -> None:
def do_change_tos_version(user_profile: UserProfile, tos_version: Optional[str]) -> None:
user_profile.tos_version = tos_version
user_profile.save(update_fields=["tos_version"])
event_time = timezone_now()