diff options
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 7 |
1 files changed, 4 insertions, 3 deletions
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( |