From 42e670964c037cf9edf11b3fa12c6ab6465362da Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 15 Jun 2014 19:46:25 +0200 Subject: Administrativ act: fix bad index --- ishtar_common/models.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 1aaaf933a..3c33928a9 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -54,6 +54,8 @@ def post_save_user(sender, **kwargs): ishtaruser = IshtarUser.create_from_user(user) else: ishtaruser = q.all()[0] + ADMINISTRATOR, created = PersonType.objects.get_or_create( + txt_idx='administrator') if ishtaruser.is_superuser \ and not ishtaruser.has_right('administrator'): ishtaruser.person.person_types.add(ADMINISTRATOR) @@ -753,9 +755,6 @@ class PersonType(GeneralType): verbose_name_plural = _(u"Person types") ordering = ('label',) -ADMINISTRATOR, created = PersonType.objects.get_or_create( - txt_idx='administrator') - class Person(Address, OwnPerms, ValueGetter) : _prefix = 'person_' TYPE = (('Mr', _(u'Mr')), @@ -857,6 +856,8 @@ class IshtarUser(User): email = user.email person_type = None if user.is_superuser: + ADMINISTRATOR, created = PersonType.objects.get_or_create( + txt_idx='administrator') person_type = ADMINISTRATOR else: person_type, created = PersonType.objects.get_or_create( -- cgit v1.2.3