2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

Simplify event triggering

- add generic receivers for database actions
- exclude django_q tables, otherwise we get an infinite loop!

Ref: https://stackoverflow.com/questions/17507784/consolidating-multiple-post-save-signals-with-one-receiver/32230933#32230933
This commit is contained in:
Oliver
2022-01-10 17:24:53 +11:00
parent 4ddd6bc351
commit 886b1f1d72
6 changed files with 54 additions and 85 deletions

View File

@ -1067,11 +1067,6 @@ def after_save_build(sender, instance: Build, created: bool, **kwargs):
# Run checks on required parts
InvenTree.tasks.offload_task('build.tasks.check_build_stock', instance)
trigger_event('build.created', build_id=instance.pk)
else:
trigger_event('build.saved', build_id=instance.pk)
class BuildOrderAttachment(InvenTreeAttachment):
"""