Don't trigger signals when we add an object through a permission check
This commit is contained in:
parent
353416618a
commit
78586b9343
6 changed files with 25 additions and 23 deletions
|
|
@ -6,7 +6,7 @@ def save_user_profile(instance, created, raw, **_kwargs):
|
|||
"""
|
||||
Hook to create and save a profile when an user is updated if it is not registered with the signup form
|
||||
"""
|
||||
if not raw and created and instance.is_active:
|
||||
if not raw and created and instance.is_active and not hasattr(instance, "_no_signal"):
|
||||
from .models import Profile
|
||||
Profile.objects.get_or_create(user=instance)
|
||||
if instance.is_superuser:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue