move apps to own dir
This commit is contained in:
parent
7b23537ce1
commit
fd9b9c34c7
29 changed files with 4 additions and 0 deletions
23
apps/note/signals.py
Normal file
23
apps/note/signals.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# -*- mode: python; coding: utf-8 -*-
|
||||
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
|
||||
def save_user_note(instance, created, **_kwargs):
|
||||
"""
|
||||
Hook to create and save a note when an user is updated
|
||||
"""
|
||||
if created:
|
||||
from .models import NoteUser
|
||||
NoteUser.objects.create(user=instance)
|
||||
instance.note.save()
|
||||
|
||||
|
||||
def save_club_note(instance, created, **_kwargs):
|
||||
"""
|
||||
Hook to create and save a note when a club is updated
|
||||
"""
|
||||
if created:
|
||||
from .models import NoteClub
|
||||
NoteClub.objects.create(club=instance)
|
||||
instance.note.save()
|
||||
Loading…
Add table
Add a link
Reference in a new issue