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:
parent
cde35ea9f9
commit
3e42f4fffb
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user