From 13d8bf437a682fd7b3ec4c5b776ed62163f2923c Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 10 Jan 2022 09:02:11 +1100 Subject: [PATCH] PEP fixes --- InvenTree/build/models.py | 8 ++++---- InvenTree/order/models.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/InvenTree/build/models.py b/InvenTree/build/models.py index 08cee20c60..fb506d5ec9 100644 --- a/InvenTree/build/models.py +++ b/InvenTree/build/models.py @@ -1067,10 +1067,10 @@ 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, - ) + trigger_event('build.created', build_id=instance.pk) + + else: + trigger_event('build.saved', build_id=instance.pk) class BuildOrderAttachment(InvenTreeAttachment): diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index a331ddf491..5fad9ea692 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -471,7 +471,7 @@ class PurchaseOrder(Order): @receiver(post_save, sender=PurchaseOrder, dispatch_uid='po_post_save_log') -def after_save_build(sender, instance: PurchaseOrder, created: bool, **kwargs): +def after_save_po(sender, instance: PurchaseOrder, created: bool, **kwargs): if created: trigger_event('purchaseorder.created', order_id=instance.pk) @@ -773,7 +773,7 @@ class SalesOrder(Order): @receiver(post_save, sender=SalesOrder, dispatch_uid='so_post_save_log') -def after_save_build(sender, instance: SalesOrder, created: bool, **kwargs): +def after_save_so(sender, instance: SalesOrder, created: bool, **kwargs): if created: trigger_event('salesorder.created', order_id=instance.pk)