mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Use the tablename when generating automatic model events
This commit is contained in:
parent
972cff493e
commit
f1d8bf71b7
@ -163,17 +163,15 @@ def after_save(sender, instance, created, **kwargs):
|
||||
|
||||
if created:
|
||||
trigger_event(
|
||||
'instance.created',
|
||||
f'{table}.created',
|
||||
id=instance.id,
|
||||
model=sender.__name__,
|
||||
table=table,
|
||||
)
|
||||
else:
|
||||
trigger_event(
|
||||
'instance.saved',
|
||||
f'{table}.saved',
|
||||
id=instance.id,
|
||||
model=sender.__name__,
|
||||
table=table,
|
||||
)
|
||||
|
||||
|
||||
@ -189,9 +187,8 @@ def after_delete(sender, instance, **kwargs):
|
||||
return
|
||||
|
||||
trigger_event(
|
||||
'instance.deleted',
|
||||
f'{table}.deleted',
|
||||
model=sender.__name__,
|
||||
table=table,
|
||||
)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user