Skip to content

Commit

Permalink
~ changed password field for compatibility with django 1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pmayer committed Oct 3, 2018
1 parent 920fd3e commit ef0895e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mama_cas/forms.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging

import django
from django import forms
from django.conf import settings
from django.contrib.auth import authenticate
Expand All @@ -14,10 +15,13 @@ class LoginForm(forms.Form):
username = forms.CharField(label=_("Username"),
error_messages={'required':
_("Please enter your username")})
password = forms.CharField(label=_("Password"), widget=forms.PasswordInput, strip=False,
password = forms.CharField(label=_("Password"), widget=forms.PasswordInput,
error_messages={'required':
_("Please enter your password")})

if django.VERSION >= (1, 9):
password.strip = False

def __init__(self, *args, **kwargs):
self.request = kwargs.pop('request', None)
super(LoginForm, self).__init__(*args, **kwargs)
Expand Down

0 comments on commit ef0895e

Please sign in to comment.