mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 18:08:21 +02:00
Use pre_delete signal insted of Model.delete() to prevent note balance issues when deleting a transaction (don't do it) in Django Admin
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
|
||||
from django.apps import AppConfig
|
||||
from django.conf import settings
|
||||
from django.db.models.signals import post_save
|
||||
from django.db.models.signals import post_save, pre_delete
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from . import signals
|
||||
@ -25,3 +25,8 @@ class NoteConfig(AppConfig):
|
||||
signals.save_club_note,
|
||||
sender='member.Club',
|
||||
)
|
||||
|
||||
pre_delete.connect(
|
||||
signals.delete_transaction,
|
||||
sender='note.transaction',
|
||||
)
|
||||
|
Reference in New Issue
Block a user