mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Logging is finally processed at post saved, but old instance is querried
This commit is contained in:
@ -6,7 +6,7 @@ from django.conf import settings
|
||||
from django.db.models.signals import post_save
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from .signals import save_user_note
|
||||
from .signals import save_user_profile
|
||||
|
||||
|
||||
class MemberConfig(AppConfig):
|
||||
@ -18,6 +18,6 @@ class MemberConfig(AppConfig):
|
||||
Define app internal signals to interact with other apps
|
||||
"""
|
||||
post_save.connect(
|
||||
save_user_note,
|
||||
save_user_profile,
|
||||
sender=settings.AUTH_USER_MODEL,
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
def save_user_note(instance, created, raw, **_kwargs):
|
||||
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
|
||||
"""
|
||||
@ -11,5 +11,5 @@ def save_user_note(instance, created, raw, **_kwargs):
|
||||
|
||||
if created:
|
||||
from .models import Profile
|
||||
Profile.objects.get_or_create(user=instance)
|
||||
#Profile.objects.get_or_create(user=instance)
|
||||
instance.profile.save()
|
||||
|
Reference in New Issue
Block a user