1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

superusers at creation gets automatically valid registration

This commit is contained in:
Pierre-antoine Comby 2020-09-02 17:22:06 +02:00
parent cde35ea9f9
commit 3e42f4fffb

View File

@ -13,4 +13,7 @@ def save_user_profile(instance, created, raw, **_kwargs):
if created and instance.is_active:
from .models import Profile
Profile.objects.get_or_create(user=instance)
if instance.is_superuser:
instance.profile.email_confirmed = True
instance.profile.registration_valid = True
instance.profile.save()