mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-23 00:06:16 +00:00
Log plugin event errors (#6455)
* Log plugin event errors - Log errors from plugins running process_event function * Catch exception on custom validation * Catch some more errors * Fix circular imports
This commit is contained in:
1 parent
af4d888b1b
commit
325841dbf1
4 files changed
+29
-2
No files matched your search
@@ -25,6 +25,7 @@ from mptt.models import MPTTModel, TreeForeignKey
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
import common.models
|
||||
import InvenTree.exceptions
|
||||
import InvenTree.helpers
|
||||
import InvenTree.models
|
||||
import InvenTree.ready
|
||||
@@ -601,6 +602,10 @@ class StockItem(
|
||||
plugin.validate_batch_code(self.batch, self)
|
||||
except ValidationError as exc:
|
||||
raise ValidationError({'batch': exc.message})
|
||||
except Exception:
|
||||
InvenTree.exceptions.log_error(
|
||||
f'plugin.{plugin.slug}.validate_batch_code'
|
||||
)
|
||||
|
||||
def clean(self):
|
||||
"""Validate the StockItem object (separate to field validation).
|
||||
|
||||
Reference in new issue
Block a user