From 3e42f4fffb99918cfa57e3efca82572e9e2e98ff Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Wed, 2 Sep 2020 17:22:06 +0200 Subject: [PATCH] superusers at creation gets automatically valid registration --- apps/member/signals.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/member/signals.py b/apps/member/signals.py index fbb66c1f..70162b37 100644 --- a/apps/member/signals.py +++ b/apps/member/signals.py @@ -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()