flows: handle error when app cannot be found during import
This commit is contained in:
parent
bbf0ca92af
commit
02c762c268
|
@ -157,7 +157,13 @@ class FlowImporter:
|
||||||
entries = deepcopy(self.__import.entries)
|
entries = deepcopy(self.__import.entries)
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
model_app_label, model_name = entry.model.split(".")
|
model_app_label, model_name = entry.model.split(".")
|
||||||
|
try:
|
||||||
model: SerializerModel = apps.get_model(model_app_label, model_name)
|
model: SerializerModel = apps.get_model(model_app_label, model_name)
|
||||||
|
except LookupError:
|
||||||
|
self.logger.error(
|
||||||
|
"app or model does not exist", app=model_app_label, model=model_name
|
||||||
|
)
|
||||||
|
return False
|
||||||
# Validate each single entry
|
# Validate each single entry
|
||||||
try:
|
try:
|
||||||
serializer = self._validate_single(entry)
|
serializer = self._validate_single(entry)
|
||||||
|
|
Reference in New Issue