From 3b435bb6559824f5a0dc07709d132b8f25d00d15 Mon Sep 17 00:00:00 2001 From: Marc Date: Fri, 24 Oct 2014 10:47:59 +0000 Subject: [PATCH] Added support for password migration --- orchestra/apps/accounts/settings.py | 1 + orchestra/forms/options.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/orchestra/apps/accounts/settings.py b/orchestra/apps/accounts/settings.py index efdac9db..66100d37 100644 --- a/orchestra/apps/accounts/settings.py +++ b/orchestra/apps/accounts/settings.py @@ -8,6 +8,7 @@ ACCOUNTS_TYPES = getattr(settings, 'ACCOUNTS_TYPES', ( ('CUSTOMER', _("Customer")), ('COMPANY', _("Company")), ('PUBLICBODY', _("Public body")), + ('STAFF', _("Staff")), )) ACCOUNTS_DEFAULT_TYPE = getattr(settings, 'ACCOUNTS_DEFAULT_TYPE', 'INDIVIDUAL') diff --git a/orchestra/forms/options.py b/orchestra/forms/options.py index 633ae8db..6f415431 100644 --- a/orchestra/forms/options.py +++ b/orchestra/forms/options.py @@ -51,6 +51,7 @@ class UserCreationForm(forms.ModelForm): super(UserCreationForm, self).__init__(*args, **kwargs) if settings.ORCHESTRA_MIGRATION_MODE: self.fields['password1'].widget = forms.TextInput(attrs={'size':'130'}) + self.fields['password1'].help_text = _("RAW password digest (migration mode is enabled).") self.fields['password2'].widget = forms.HiddenInput() self.fields['password2'].required = False @@ -78,7 +79,7 @@ class UserCreationForm(forms.ModelForm): def save(self, commit=True): user = super(UserCreationForm, self).save(commit=False) - if not settings.ORCHESTRA_MIGRATION_MODE: + if settings.ORCHESTRA_MIGRATION_MODE: user.password = self.cleaned_data['password1'] else: user.set_password(self.cleaned_data['password1'])