From ee210d1dbeac6b1ff43a9119cbcaeae7138282f1 Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki Date: Tue, 16 Oct 2012 18:53:26 +0300 Subject: [PATCH] Change setting name Refs: #2612 --- snf-astakos-app/README | 2 +- snf-astakos-app/astakos/im/forms.py | 10 +++++----- snf-astakos-app/astakos/im/settings.py | 2 +- snf-astakos-app/conf/20-snf-astakos-app-settings.conf | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/snf-astakos-app/README b/snf-astakos-app/README index 8ef49c6..617ea32 100644 --- a/snf-astakos-app/README +++ b/snf-astakos-app/README @@ -89,7 +89,7 @@ ASTAKOS_ADMIN_NOTIFICATION_EMAIL_SUBJECT '%s alpha2 testing account created ( ASTAKOS_HELPDESK_NOTIFICATION_EMAIL_SUBJECT '%s alpha2 testing account activated (%%(user)s)' % SITENAME Account activation helpdesk notification email subject ASTAKOS_EMAIL_CHANGE_EMAIL_SUBJECT 'Email change on %s alpha2 testing' % SITENAME Email change subject ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT 'Password reset on %s alpha2 testing' % SITENAME Password change email subject -ASTAKOS_ENFORCE_TOKEN_RENEWAL True Enforce token renewal on password change/reset. If set to False, user can optionally decide +ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN True Enforce token renewal on password change/reset. If set to False, user can optionally decide whether to renew the token or not. =========================================== ============================================================================= =========================================================================================== diff --git a/snf-astakos-app/astakos/im/forms.py b/snf-astakos-app/astakos/im/forms.py index bad3236..b3d2be1 100644 --- a/snf-astakos-app/astakos/im/forms.py +++ b/snf-astakos-app/astakos/im/forms.py @@ -51,7 +51,7 @@ from astakos.im.models import AstakosUser, Invitation, get_latest_terms, EmailCh from astakos.im.settings import INVITATIONS_PER_LEVEL, DEFAULT_FROM_EMAIL, \ BASEURL, SITENAME, RECAPTCHA_PRIVATE_KEY, DEFAULT_CONTACT_EMAIL, \ RECAPTCHA_ENABLED, LOGGING_LEVEL, PASSWORD_RESET_EMAIL_SUBJECT, \ - ENFORCE_TOKEN_RENEWAL + NEWPASSWD_INVALIDATE_TOKEN from astakos.im.widgets import DummyWidget, RecaptchaWidget from astakos.im.functions import send_change_email @@ -475,7 +475,7 @@ class ExtendedPasswordChangeForm(PasswordChangeForm): Extends PasswordChangeForm by enabling user to optionally renew also the token. """ - if not ENFORCE_TOKEN_RENEWAL: + if not NEWPASSWD_INVALIDATE_TOKEN: renew = forms.BooleanField(label='Renew token', required=False, initial=True, help_text='Unsetting this may result in security risk.') @@ -485,7 +485,7 @@ class ExtendedPasswordChangeForm(PasswordChangeForm): def save(self, commit=True): user = super(ExtendedPasswordChangeForm, self).save(commit=False) - if ENFORCE_TOKEN_RENEWAL or self.cleaned_data.get('renew'): + if NEWPASSWD_INVALIDATE_TOKEN or self.cleaned_data.get('renew'): user.renew_token() if commit: user.save() @@ -496,7 +496,7 @@ class ExtendedSetPasswordForm(SetPasswordForm): Extends SetPasswordForm by enabling user to optionally renew also the token. """ - if not ENFORCE_TOKEN_RENEWAL: + if not NEWPASSWD_INVALIDATE_TOKEN: renew = forms.BooleanField(label='Renew token', required=False, initial=True, help_text='Unsetting this may result in security risk.') @@ -506,7 +506,7 @@ class ExtendedSetPasswordForm(SetPasswordForm): def save(self, commit=True): user = super(ExtendedSetPasswordForm, self).save(commit=False) - if ENFORCE_TOKEN_RENEWAL or self.cleaned_data.get('renew'): + if NEWPASSWD_INVALIDATE_TOKEN or self.cleaned_data.get('renew'): try: user = AstakosUser.objects.get(id=user.id) except AstakosUser.DoesNotExist: diff --git a/snf-astakos-app/astakos/im/settings.py b/snf-astakos-app/astakos/im/settings.py index c333b54..da60994 100644 --- a/snf-astakos-app/astakos/im/settings.py +++ b/snf-astakos-app/astakos/im/settings.py @@ -119,4 +119,4 @@ PASSWORD_RESET_EMAIL_SUBJECT = getattr(settings, 'ASTAKOS_PASSWORD_RESET_EMAIL_S 'Password reset on %s alpha2 testing' % SITENAME) # Enforce token renewal on password change/reset -ENFORCE_TOKEN_RENEWAL = getattr(settings, 'ASTAKOS_ENFORCE_TOKEN_RENEWAL', True) \ No newline at end of file +NEWPASSWD_INVALIDATE_TOKEN = getattr(settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True) \ No newline at end of file diff --git a/snf-astakos-app/conf/20-snf-astakos-app-settings.conf b/snf-astakos-app/conf/20-snf-astakos-app-settings.conf index dc3b972..b0f2291 100644 --- a/snf-astakos-app/conf/20-snf-astakos-app-settings.conf +++ b/snf-astakos-app/conf/20-snf-astakos-app-settings.conf @@ -112,4 +112,4 @@ #ASTAKOS_PASSWORD_RESET_EMAIL_SUBJECT = 'Password reset on %s alpha2 testing' % SITENAME # Enforce token renewal on password change/reset -# ENFORCE_TOKEN_RENEWAL = getattr(settings, 'ASTAKOS_ENFORCE_TOKEN_RENEWAL', True) +NEWPASSWD_INVALIDATE_TOKEN = getattr(settings, 'ASTAKOS_NEWPASSWD_INVALIDATE_TOKEN', True) \ No newline at end of file -- 1.7.10.4