diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2014-06-15 19:46:25 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2014-06-15 19:46:25 +0200 | 
| commit | 42e670964c037cf9edf11b3fa12c6ab6465362da (patch) | |
| tree | 14fd19cba5728d93dccdee96daf84aaf5309de1b /ishtar_common/models.py | |
| parent | 1dce12d7a7c1a7db7a0b467b09248b3b8d2e3724 (diff) | |
| download | Ishtar-42e670964c037cf9edf11b3fa12c6ab6465362da.tar.bz2 Ishtar-42e670964c037cf9edf11b3fa12c6ab6465362da.zip | |
Administrativ act: fix bad index
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( | 
