mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-18 14:07:41 +00:00
Exception handling (#5622)
* get_setting_object: Handle ProgrammingError * Improved exception handling - Address a few cases on application startup if the database is not ready (migrations not applied)
This commit is contained in:
1 parent
2b0d81fd81
commit
08e7190832
4 files changed
+22
-13
No files matched your search
@@ -182,8 +182,11 @@ class LabelConfig(AppConfig):
|
||||
shutil.copyfile(src_file, dst_file)
|
||||
|
||||
# Check if a label matching the template already exists
|
||||
if model.objects.filter(label=filename).exists():
|
||||
return # pragma: no cover
|
||||
try:
|
||||
if model.objects.filter(label=filename).exists():
|
||||
return # pragma: no cover
|
||||
except Exception:
|
||||
logger.error(f"Failed to query label for '{filename}' - you should run 'invoke update' first!")
|
||||
|
||||
logger.info(f"Creating entry for {model} '{label['name']}'")
|
||||
|
||||
|
||||
Reference in new issue
Block a user