macropin / django-registration

Django-registration (redux) provides user registration functionality for Django websites.
http://django-registration-redux.readthedocs.org
Other
975 stars 350 forks source link

save user and registration profile in one transaction #368

Closed pacahon closed 4 years ago

pacahon commented 4 years ago

Default registration form based on django.contrib.auth.forms.UserCreationForm which saves active user to db. This PR prevents it and moves user saving to registration.models.RegistrationManager.create_inactive_user.

It is up to the developer to maintain this behavior in case of a custom registering form. Especially when custom form omit the save method since the default UserModel().objects.create_user implementation also saves user to db.

pacahon commented 4 years ago

I don't understand what's wrong with travis and how to debug it. Locally isort doesn't complain about anything in the default_backend.py. make lint also works fine.

joshblum commented 4 years ago

thanks!

pacahon commented 4 years ago

@joshblum travis build is still failing. Is it possible to output some debug info behind make lint command? Then I could fix an error. Locally I tested imports order with the same isort version (4.3.21)

joshblum commented 4 years ago

adding the --verbose flag to the call to isort might help:
https://github.com/macropin/django-registration/blob/master/tasks.py#L30

-vb, --verbose        Shows verbose output, such as when files are skipped
                        or when a check is successful.
pacahon commented 4 years ago

I'm still confused.

SUCCESS: /Users/pacahon/PycharmProjects/django-registration/registration/tests/default_backend.py Everything Looks Good!
joshblum commented 4 years ago

was this on CI?

joshblum commented 4 years ago

fixed here: https://github.com/macropin/django-registration/pull/370