Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserCreationForm doesn't use Django 1.9's password validation #55

Open
gavinwahl opened this issue Sep 21, 2015 · 6 comments
Open

UserCreationForm doesn't use Django 1.9's password validation #55

gavinwahl opened this issue Sep 21, 2015 · 6 comments

Comments

@gavinwahl
Copy link
Member

It needs to call django.contrib.auth.password_validation.validate_password to hook in to https://docs.djangoproject.com/en/dev/topics/auth/passwords/#enabling-password-validation

@rockymeza
Copy link
Contributor

@SpaceK33z
Copy link

When trying to use authtools with Django 1.9 I get the following error:

django.core.management.base.SystemCheckError: SystemCheckError: System check identified some issues:

ERRORS:
<class 'files.admin.UserAdmin'>: (admin.E108) The value of 'list_display[2]' refers to 'name', which is not a callable, an attribute of 'UserAdmin', or an attribute or method on 'auth.User'.

Is this ticket related to that error?

@gavinwahl
Copy link
Member Author

I don't think that's related. Can you open another issue with the value of AUTH_USER_MODEL and files.admin.UserAdmin?

@raratiru
Copy link

raratiru commented Apr 26, 2016

At first glance, the mechanism without the help text, seems like it will work modifying the clean_password2 in forms.py:

Django method vs authtools method

At second glance, care should be taken for the USERNAME_FIELD which is different in EmailUser and NameUser classes. Except if self.cleaned_data.get('username') automatically fetches the relevant field.

I will give it a try, when I am not at work...

@elnygren
Copy link

elnygren commented Oct 3, 2016

I am currently using this solution, which should be easy to adapt for authtools

from authtools.forms import UserCreationForm
from django.contrib.auth.password_validation import validate_password

class SignupForm(UserCreationForm):
    class Meta:
        model = User
        fields = [
            'name',
            'email',
            'password1',
            'password2'
        ]

    def clean_password1(self):
        validate_password(self.cleaned_data.get('password1'))

@xkill
Copy link

xkill commented Apr 26, 2017

Same problem on Django 1.10.6

@bgaudino bgaudino self-assigned this Jul 13, 2022
@bgaudino bgaudino removed their assignment Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants