Skip to content
Snippets Groups Projects
Commit 996672f9 authored by florian's avatar florian
Browse files

FIX: Keep existing names and description when updating properties

parent 53ce6836
No related branches found
No related tags found
2 merge requests!71REL: RElease v0.2.0,!61F fix crawler overwrite
Pipeline #29900 passed
...@@ -740,6 +740,17 @@ class Crawler(object): ...@@ -740,6 +740,17 @@ class Crawler(object):
else: else:
# side effect # side effect
record.id = identified_record.id record.id = identified_record.id
# Special treatment for name and description in case
# they have been set in the server independently from
# the crawler
for attr in ["name", "description"]:
if getattr(record, attr) is None:
# The crawler didn't find any name or
# description, i.e., not an empty one. In this
# case (and only in this), keep any existing
# name or description.
setattr(record, attr, getattr(
identified_record, attr))
# Copy over checksum and size too if it is a file # Copy over checksum and size too if it is a file
if isinstance(record, db.File): if isinstance(record, db.File):
record._size = identified_record._size record._size = identified_record._size
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment