Merge pull request #131 from francescarpi/master

Added CONSTANCE_IGNORE_ADMIN_VERSION_CHECK settings option to ignore …
This commit is contained in:
Camilo Nova 2016-03-08 08:38:21 -05:00
commit 468daf5eea
3 changed files with 17 additions and 0 deletions

View file

@ -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 '

View file

@ -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)

View file

@ -53,6 +53,15 @@ admin will show.
See the :ref:`Backends <backends>` section how to setup the backend and
finish the configuration.
``django-constance``'s hashes generated in different instances of the same
application may differ, preventing data from being saved.
Use this option in order to skip hash verification.
.. code-block:: python
CONSTANCE_IGNORE_ADMIN_VERSION_CHECK = True
Custom fields
-------------