Skip to content
Snippets Groups Projects
Commit 50f3a74f authored by Alexander Schlemmer's avatar Alexander Schlemmer
Browse files

FIX: additional type checks for necessary for variable substitution

parent 188ca288
Branches
Tags
2 merge requests!53Release 0.1,!21F use substitution templates
Pipeline #22884 passed with warnings
...@@ -96,6 +96,9 @@ def handle_value(value: Union[dict, str], values: GeneralStore): ...@@ -96,6 +96,9 @@ def handle_value(value: Union[dict, str], values: GeneralStore):
if match is not None: if match is not None:
varname = match.group("varname") varname = match.group("varname")
if varname in values: if varname in values:
if values[varname] is None:
propvalue = None
return (propvalue, collection_mode)
if isinstance(values[varname], db.Entity): if isinstance(values[varname], db.Entity):
propvalue = values[varname] propvalue = values[varname]
return (propvalue, collection_mode) return (propvalue, collection_mode)
......
...@@ -769,6 +769,7 @@ class Crawler(object): ...@@ -769,6 +769,7 @@ class Crawler(object):
updateList) updateList)
# remove unnecessary updates from list # remove unnecessary updates from list
# TODO: refactoring of typo
for el in to_be_updated: for el in to_be_updated:
self.replace_entities_by_ids(el) self.replace_entities_by_ids(el)
......
...@@ -249,6 +249,8 @@ def test_crawler_update_list(crawler, ident): ...@@ -249,6 +249,8 @@ def test_crawler_update_list(crawler, ident):
def test_synchronization(crawler, ident): def test_synchronization(crawler, ident):
insl, updl = crawler.synchronize(commit_changes=False) insl, updl = crawler.synchronize(commit_changes=False)
# breakpoint()
# ident.check_record(ident.get_records()[1], insl[0])
assert len(insl) == 0 assert len(insl) == 0
assert len(updl) == 0 assert len(updl) == 0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment