From 758ee42b4970372d38d620f80c51854abc64a69f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 17 Dec 2013 01:53:53 +0100 Subject: Choose document to generate at the end of create/modif process --- ishtar_common/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 611a6089c..77a7d6562 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -765,7 +765,11 @@ class Person(Address, OwnPerms, ValueGetter) : def get_values(self, prefix=''): values = super(Person, self).get_values(prefix=prefix) - values[prefix+'title'] = dict(self.TYPE)[self.title] + title = '' + TYPES = dict(self.TYPE) + if self.title in TYPES: + title = dict(self.TYPE)[self.title] + values[prefix+'title'] = title if not self.attached_to: values.update(Person.get_empty_values(prefix=prefix + 'attached_to_')) return values -- cgit v1.2.3