diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-16 18:16:26 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-10-16 18:16:26 +0200 | 
| commit | 5531f4d023d0d62d915b00a9cd103ab06d98b585 (patch) | |
| tree | 7eda2b86e94ee3abc32a685186ef08678a513d49 | |
| parent | f1df92295e909d6e712b7d65ee9fcb2fb8d7cd5f (diff) | |
| download | Ishtar-5531f4d023d0d62d915b00a9cd103ab06d98b585.tar.bz2 Ishtar-5531f4d023d0d62d915b00a9cd103ab06d98b585.zip | |
Author: fix get by natural key
| -rw-r--r-- | ishtar_common/models.py | 6 | 
1 files changed, 3 insertions, 3 deletions
| 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) | 
