mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Test and cover note app
This commit is contained in:
@ -6,11 +6,7 @@ def save_user_note(instance, raw, **_kwargs):
|
||||
"""
|
||||
Hook to create and save a note when an user is updated
|
||||
"""
|
||||
if raw:
|
||||
# When provisionning data, do not try to autocreate
|
||||
return
|
||||
|
||||
if instance.is_superuser or instance.profile.registration_valid:
|
||||
if not raw and (instance.is_superuser or instance.profile.registration_valid):
|
||||
# Create note only when the registration is validated
|
||||
from note.models import NoteUser
|
||||
NoteUser.objects.get_or_create(user=instance)
|
||||
|
Reference in New Issue
Block a user