mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Ignore events from 'webhook' tables
This commit is contained in:
parent
5f955fab80
commit
4f79904fc8
@ -124,6 +124,8 @@ def allow_table_event(table_name):
|
|||||||
|
|
||||||
ignore_tables = [
|
ignore_tables = [
|
||||||
'common_notificationentry',
|
'common_notificationentry',
|
||||||
|
'common_webhookendpoint',
|
||||||
|
'common_webhookmessage',
|
||||||
]
|
]
|
||||||
|
|
||||||
if table_name in ignore_tables:
|
if table_name in ignore_tables:
|
||||||
@ -140,6 +142,11 @@ def after_save(sender, instance, created, **kwargs):
|
|||||||
|
|
||||||
table = sender.objects.model._meta.db_table
|
table = sender.objects.model._meta.db_table
|
||||||
|
|
||||||
|
instance_id = getattr(instance, 'id', None)
|
||||||
|
|
||||||
|
if instance_id is None:
|
||||||
|
return
|
||||||
|
|
||||||
if not allow_table_event(table):
|
if not allow_table_event(table):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user