Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add password rules for more security

Roland Geider8543f00bcbbe
diff --git a/docs/changelog.rst b/docs/changelog.rst
index e351b3ad6..f7e2d332a 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -6,6 +6,19 @@ Changelog
--------------------
**2017-xx-xx**
+Upgrade steps from 1.8:
+
+* Django update to 1.10: ``pip install -r requirements.txt``
+* Database upgrade: ``python manage.py migrate``
+
+New features:
+
+* ...
+
+Improvements:
+
+* Added password validation rules for more security
+
Other improvements and bugfixes: `#336`_, `#359`_,
.. _#336: https://github.com/wger-project/wger/issues/336
diff --git a/wger/core/templates/tags/render_form_element.html b/wger/core/templates/tags/render_form_element.html
index a3a41e244..6a1d949ce 100644
--- a/wger/core/templates/tags/render_form_element.html
+++ b/wger/core/templates/tags/render_form_element.html
@@ -29,7 +29,7 @@
<p>{% trans error %}</p>
{% endfor %}
- {% if field.help_text %}{% trans field.help_text %}{% endif %}
+ {% if field.help_text %}{% trans field.help_text|safe %}{% endif %}
</span>
</div>
diff --git a/wger/settings_global.py b/wger/settings_global.py
index 9da984b5b..ecbc3bea3 100644
--- a/wger/settings_global.py
+++ b/wger/settings_global.py
@@ -363,6 +363,24 @@ IGNORABLE_404_URLS = (
re.compile(r'^/favicon\.ico$'),
)
+#
+# Password rules
+#
+AUTH_PASSWORD_VALIDATORS = [
+ {
+ 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+ },
+ {
+ 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+ },
+]
+
#
# Application specific configuration options
#