mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
make unloading safer
This commit is contained in:
parent
b16305afef
commit
cf986e557c
@ -523,7 +523,10 @@ class PluginsRegistry:
|
||||
# check all models
|
||||
for model in app_config.get_models():
|
||||
# remove model from admin site
|
||||
admin.site.unregister(model)
|
||||
try:
|
||||
admin.site.unregister(model)
|
||||
except:
|
||||
pass
|
||||
models += [model._meta.model_name]
|
||||
except LookupError: # pragma: no cover
|
||||
# if an error occurs the app was never loaded right -> so nothing to do anymore
|
||||
|
Loading…
Reference in New Issue
Block a user