Tests match_from_mappings

This commit is contained in:
Mouse Reeve
2020-05-11 10:40:48 -07:00
parent 6d08996ee9
commit 0dde027f3d
2 changed files with 63 additions and 1 deletions

View File

@ -182,7 +182,7 @@ class AbstractConnector(ABC):
def match_from_mappings(self, data, model):
''' try to find existing copies of this book using various keys '''
relevent_mappings = [m for m in self.key_mappings if \
m.model and model == m.model]
not m.model or model == m.model]
for mapping in relevent_mappings:
# check if this field is present in the data
value = data.get(mapping.remote_field)