Tests match_from_mappings
This commit is contained in:
parent
6d08996ee9
commit
0dde027f3d
2 changed files with 63 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue