mirror of https://gitlab.crans.org/bde/nk20
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:
|
if created and instance.is_active:
|
||||||
from .models import Profile
|
from .models import Profile
|
||||||
Profile.objects.get_or_create(user=instance)
|
Profile.objects.get_or_create(user=instance)
|
||||||
|
if instance.is_superuser:
|
||||||
|
instance.profile.email_confirmed = True
|
||||||
|
instance.profile.registration_valid = True
|
||||||
instance.profile.save()
|
instance.profile.save()
|
||||||
|
|
Loading…
Reference in New Issue