1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 09:58:23 +02:00

List pending users

This commit is contained in:
Yohann D'ANELLO
2020-04-05 06:40:03 +02:00
parent 49807d33d9
commit f10497bac3
11 changed files with 95 additions and 13 deletions

View File

@ -2,7 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
def save_user_note(instance, created, raw, **_kwargs):
def save_user_note(instance, raw, **_kwargs):
"""
Hook to create and save a note when an user is updated
"""
@ -10,10 +10,11 @@ def save_user_note(instance, created, raw, **_kwargs):
# When provisionning data, do not try to autocreate
return
if created:
from .models import NoteUser
NoteUser.objects.create(user=instance)
instance.note.save()
if instance.profile.registration_valid and instance.is_active:
# Create note only when the registration is validated
from note.models import NoteUser
NoteUser.objects.get_or_create(user=instance)
instance.note.save()
def save_club_note(instance, created, raw, **_kwargs):