mirror of
https://github.com/jazzband/django-constance.git
synced 2026-05-23 06:35:50 +00:00
Added CONSTANCE_IGNORE_ADMIN_VERSION_CHECK settings option to ignore the version protection. When you use django-constance on a cloud platform, with several machines, giving you problems by keeping the machine does not have to be the same which has served constant form.
This commit is contained in:
parent
70c4f0a3ad
commit
1b9458c74b
2 changed files with 8 additions and 0 deletions
|
|
@ -103,6 +103,10 @@ class ConstanceForm(forms.Form):
|
|||
|
||||
def clean_version(self):
|
||||
value = self.cleaned_data['version']
|
||||
|
||||
if settings.IGNORE_ADMIN_VERSION_CHECK:
|
||||
return value
|
||||
|
||||
if value != self.initial['version']:
|
||||
raise forms.ValidationError(_('The settings have been modified '
|
||||
'by someone else. Please reload the '
|
||||
|
|
|
|||
|
|
@ -24,3 +24,7 @@ REDIS_CONNECTION_CLASS = getattr(settings, 'CONSTANCE_REDIS_CONNECTION_CLASS',
|
|||
REDIS_CONNECTION = getattr(settings, 'CONSTANCE_REDIS_CONNECTION', {})
|
||||
|
||||
SUPERUSER_ONLY = getattr(settings, 'CONSTANCE_SUPERUSER_ONLY', True)
|
||||
|
||||
IGNORE_ADMIN_VERSION_CHECK = getattr(settings,
|
||||
'CONSTANCE_IGNORE_ADMIN_VERSION_CHECK',
|
||||
False)
|
||||
|
|
|
|||
Loading…
Reference in a new issue