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

up

parent f1882a4f
No related branches found
No related tags found
2 merge requests!71REL: RElease v0.2.0,!5FIX: use identifiable instead of record
Pipeline #29323 failed
...@@ -203,14 +203,13 @@ class IdentifiableAdapter(metaclass=ABCMeta): ...@@ -203,14 +203,13 @@ class IdentifiableAdapter(metaclass=ABCMeta):
# case A: in the registered identifiable # case A: in the registered identifiable
# case B: in the identifiable # case B: in the identifiable
if record.get_property(prop.name) is None:
raise NotImplementedError()
record_prop = record.get_property(prop.name) record_prop = record.get_property(prop.name)
if record_prop is None: if record_prop is None:
# TODO: how to handle missing values in identifiables # TODO: how to handle missing values in identifiables
# raise an exception? # raise an exception?
raise NotImplementedError( raise NotImplementedError(
f"RECORD\n{record}\nPROPERTY\n{prop.name}" f"The following record is missing an identifying property:"
f"RECORD\n{record}\nIdentifying PROPERTY\n{prop.name}"
) )
newval = record_prop.value newval = record_prop.value
record_prop_new = db.Property(name=record_prop.name, record_prop_new = db.Property(name=record_prop.name,
...@@ -304,9 +303,8 @@ class LocalStorageIdentifiableAdapter(IdentifiableAdapter): ...@@ -304,9 +303,8 @@ class LocalStorageIdentifiableAdapter(IdentifiableAdapter):
with open(filename, "r") as f: with open(filename, "r") as f:
self._records = db.Container().from_xml(f.read()) self._records = db.Container().from_xml(f.read())
def is_identifiable_for_record(self, # TODO: move to super class?
registered_identifiable: db.RecordType, def is_identifiable_for_record(self, registered_identifiable: db.RecordType, record: db.Record):
record: db.Record):
""" """
Check whether this registered_identifiable is an identifiable for the record. Check whether this registered_identifiable is an identifiable for the record.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment