diff options
Diffstat (limited to 'ishtar_common/wizards.py')
| -rw-r--r-- | ishtar_common/wizards.py | 15 | 
1 files changed, 10 insertions, 5 deletions
| diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index a6d0befd5..3e153c9dd 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1619,7 +1619,6 @@ class AccountWizard(Wizard):      model = models.Person      formset_pop_deleted = False      wizard_done_window = reverse_lazy('show-person') -    modification = True      def get_formated_datas(self, forms):          datas = super(AccountWizard, self).get_formated_datas(forms) @@ -1695,6 +1694,8 @@ class AccountWizard(Wizard):                      profile.delete()                      continue +            name = data.get('name', None) +              profile_type_id = data.get('profile_type', None)              if not profile_type_id:                  continue @@ -1704,13 +1705,17 @@ class AccountWizard(Wizard):                  )              except models.ProfileType.DoesNotExist:                  continue + +            if not name: +                name = profile_type.label +              if profile: -                if profile_type != profile.profile_type: -                    profile.profile_type = profile_type -                    profile.save() +                profile.name = name +                profile.profile_type = profile_type +                profile.save()              else:                  profile = models.UserProfile.objects.create( -                    profile_type=profile_type, person=person) +                    profile_type=profile_type, person=person, name=name)              area_pks = data.get('area', None)              areas = []              if area_pks: | 
