This commit is contained in:
Daniel Miranda 2022-06-06 22:59:23 -07:00
Родитель 7f9f1569ea
Коммит 65bfd0f9de
3 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -24,7 +24,5 @@ class Migration(migrations.Migration):
]
operations = [
migrations.RunPython(
match_profile_isactive_to_user_isactive
),
migrations.RunPython(code=match_profile_isactive_to_user_isactive, reverse_code=migrations.RunPython.noop)
]

Просмотреть файл

@ -111,6 +111,9 @@ class PulseSocialAccountAdapter(DefaultSocialAccountAdapter):
try:
UserProfile.objects.get(related_user=user)
except UserProfile.DoesNotExist:
# Is_active is False by default, so we can hide this
# users profile and entries, until set to active by a moderator.
profile = UserProfile.objects.create(is_active=False)
user.profile = profile
user.save()

Просмотреть файл

@ -22,6 +22,8 @@ class EmailUserManager(BaseUserManager):
# Ensure that new users get a user profile associated
# with them, even though it'll be empty by default.
# Is_active is set to False, so we can hide this
# user's profile and entries, until set to active by a moderator.
profile = UserProfile.objects.create(is_active=False)
user = self.model(
email=email,