diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 524549446..3b260f0d6 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -8,9 +8,9 @@ django-bower==5.2.0 django-braces==1.9.0 django-crispy-forms==1.7.2 django-floppyforms==1.7.0 +django-extra-views==0.12.0 django-extensions==1.9.8 -django-extra-views==0.11.0 django-model-utils==3.1.1 django-sass-processor==0.5.8 easy-thumbnails==2.5 diff --git a/sapl/settings.py b/sapl/settings.py index fbc19f53f..78f8f7781 100755 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -22,9 +22,6 @@ from dj_database_url import parse as db_url from easy_thumbnails.conf import Settings as thumbnail_settings from unipath import Path -from .temp_suppress_crispy_form_warnings import \ - SUPRESS_CRISPY_FORM_WARNINGS_LOGGING - host = socket.gethostbyname_ex(socket.gethostname())[0] @@ -288,6 +285,7 @@ DAB_FIELD_RENDERER = \ CRISPY_TEMPLATE_PACK = 'bootstrap3' CRISPY_ALLOWED_TEMPLATE_PACKS = 'bootstrap3' CRISPY_FAIL_SILENTLY = not DEBUG +FLOPPY_FORMS_USE_GIS = False BOWER_COMPONENTS_ROOT = PROJECT_DIR.child("bower") BOWER_INSTALLED_APPS = ( @@ -345,6 +343,22 @@ LOGGING = { } } +PASSWORD_HASHERS = [ + 'django.contrib.auth.hashers.PBKDF2PasswordHasher', # default + 'sapl.hashers.ZopeSHA1PasswordHasher', +] + + +def remove_warnings(): + import warnings + warnings.filterwarnings( + 'ignore', module='floppyforms', + message='Unable to import floppyforms.gis' + ) + + +remove_warnings() + def uncaught_exceptions(type, value, error_traceback): import traceback @@ -356,8 +370,3 @@ def uncaught_exceptions(type, value, error_traceback): # captura exceções que não foram tratadas sys.excepthook = uncaught_exceptions - -PASSWORD_HASHERS = [ - 'django.contrib.auth.hashers.PBKDF2PasswordHasher', # default - 'sapl.hashers.ZopeSHA1PasswordHasher', -] diff --git a/sapl/temp_suppress_crispy_form_warnings.py b/sapl/temp_suppress_crispy_form_warnings.py deleted file mode 100644 index 39105d39e..000000000 --- a/sapl/temp_suppress_crispy_form_warnings.py +++ /dev/null @@ -1,22 +0,0 @@ -import copy -import logging - -from django.utils.log import DEFAULT_LOGGING - -# hack to suppress many annoying warnings from crispy_forms -# Do remove this file and corresponding import in settings -# when crispy_forms is corrected !!! -SUPRESS_CRISPY_FORM_WARNINGS_LOGGING = copy.deepcopy(DEFAULT_LOGGING) -SUPRESS_CRISPY_FORM_WARNINGS_LOGGING['filters']['suppress_deprecated'] = { - '()': 'sapl.temp_suppress_crispy_form_warnings.SuppressDeprecated' -} -SUPRESS_CRISPY_FORM_WARNINGS_LOGGING['handlers']['console']['filters'].append( - 'suppress_deprecated') - - -class SuppressDeprecated(logging.Filter): - - def filter(self, record): - msg = record.getMessage() - return not ('crispy_forms' in msg and - 'RemovedInDjango19Warning' in msg) diff --git a/setup.py b/setup.py index 12a1823a7..4a44886a9 100644 --- a/setup.py +++ b/setup.py @@ -19,8 +19,8 @@ install_requires = [ 'django-braces==1.9.0', 'django-crispy-forms==1.7.2', 'django-floppyforms==1.7.0', + 'django-extra-views==0.12.0', - 'django-extra-views==0.11.0', 'django-extensions==1.9.8', 'django-model-utils==3.1.1', 'django-sass-processor==0.5.8',