Skip to content
Snippets Groups Projects
Commit 2f2c6eb6 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

trial

parent 887ba40a
No related branches found
No related tags found
No related merge requests found
Pipeline #14044 failed
......@@ -588,29 +588,27 @@ carefully and if the changes are ok, click on the following link:
logger.debug("Id is known of: {}".format(ent))
# insert missing, i.e. those which are not valid
missing_identifiables = db.Container()
missing_identifiables.extend([ent for ent in identifiables
if ent.id is None or ent.id < 0])
# TODO the following should not be necessary. Fix it
for ent in missing_identifiables:
if ent.id is None or ent.id < 0:
missing = ent
ent.id = None
else:
missing = None
if len(missing_identifiables) > 0:
info = "Going to insert the following entities:\n"
if missing:
#info = "Going to insert the following entities:\n"
for ent in missing_identifiables:
info += str(ent)+"\n"
logger.debug(info)
# for ent in missing_identifiables:
# info += str(ent)+"\n"
# logger.debug(info)
if len(missing_identifiables) == 0:
logger.debug("No new entities to be inserted.")
else:
# if len(missing_identifiables) == 0:
# logger.debug("No new entities to be inserted.")
# else:
# logger.info(
# "Inserting {} Records...".format(
# len(missing_identifiables)))
try:
logger.info(
"Inserting {} Records...".format(
len(missing_identifiables)))
guard.safe_insert(missing_identifiables, unique=False,
guard.safe_insert([missing], unique=False,
flags={"force-missing-obligatory": "ignore"})
except Exception as e:
DataModelProblems.evaluate_exception(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment