From 960ab12d2d8b58003190e8d7fe0e46b525a00a37 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 16 Oct 2018 18:16:26 +0200 Subject: Author: fix get by natural key --- ishtar_common/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index c9fc8eec4..5c2875fc5 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3331,12 +3331,12 @@ class AuthorManager(models.Manager): def get_by_natural_key( self, name, surname, attached_to_name, attached_to_organization_type, author_type): - q = {"name": name, "surname": surname, + q = {"person__name": name, "person__surname": surname, "author_type__txt_idx": author_type} if attached_to_name: - q['attached_to__name'] = attached_to_name + q['person__attached_to__name'] = attached_to_name if attached_to_organization_type: - q['attached_to__organization_type__txt_idx'] = \ + q['person__attached_to__organization_type__txt_idx'] = \ attached_to_organization_type return self.get(**q) -- cgit v1.2.3