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 #367

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.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.2%) to 97.018% when pulling fdfe847211ed449fa2e9e8c9efddfa29cbacb19a on pacahon:master into ad5b391fe91d7d344894faf653c0964cd3c085c6 on macropin:master.

pacahon commented 4 years ago

I don't understand what travis wants from me.

ERROR: /home/travis/build/macropin/django-registration/registration/tests/default_backend.py Imports are incorrectly sorted.

Locally isort doesn't complain about sort order anymore. I'll try to recreate PR without push force.