Let's fix the SignupForm form #43

Closed
wants to merge 13 commits into
from

Projects

None yet

2 participants

@nigma
nigma commented Feb 21, 2012

The current SignupForm.save contains old django-friends invitation handling code and is hard to understand and customize.

I suggest to extract any email confirmation related code to separate method, keep the base form simple and provide legacy DjangoFriendsSignupForm or just get rid of that code (currently it is not triggered because no confirmation_key is passed to the form from the signup view anyway).

I also added KaleoSignupForm to the patch as example how easy it is to provide custom email verification method using the new approach.

I include full commit history in case you want to follow my way of thinking and code refactoring steps.

nigma added some commits Feb 21, 2012
@nigma nigma Pass confirmation key/code param to account.signup form as initial va…
…lue.
35fb300
@nigma nigma Moved common user creation code out of if statements. 926bb41
@nigma nigma Moved old django-friends confirmation code to separate method of Sign…
…upForm.
a13eac9
@nigma nigma Added missing call param. 1d4260e
@nigma nigma Simplifying signup form code. 4f39ed8
@nigma nigma Added a bit of doc. e4a3537
@nigma nigma Returning verification status from SignupForm.handle_confirmation.
Don't set user as inactive when his email address was already verified. Otherwise he won't have a chance to verify email address because he won't receive any confirmation message.
a905734
@nigma nigma Don't tie confirmation key to SignupCode model in case some other ver…
…ification system is used in forms.
1204cfd
@nigma nigma Wrapped user creation in db transaction block.
Otherwise User object without attached EmailAddress may be created if something goes wrong during the process.
25f5182
@nigma nigma Reorganized code and updated docstring. 759b9fa
@nigma nigma Abstracted email confirmation code during signup process.
Added default email confirmation handler to SignupForm and moved legacy django-friends join invitation code to DjangoFriendsSignupForm.
ae30944
@nigma nigma Added KaleoSignupForm as example of handling user to user invitations…
… and marking email address as verified.
3c16051
@nigma nigma Removed unused import. 1dfb035
Owner
brosner commented Feb 21, 2012

I need to do a bit more thinking with how I want this to work. I have been thinking a lot lately with how to fix pinax.apps.account. I don't think this is quite what I want. However, I am glad that you have made a start on this and getting me to think about pinax.apps.account differently.

Owner
brosner commented Mar 18, 2012

We are changing the direction of account related bits in Pinax. We've held some discussions during PyCon 2012 and have decided it is best to move pinax.apps.account outside of Pinax. We've created django-user-accounts where all future efforts will take place. I do believe it solves the issues you've tried to solve here.

I am very appreciative of the work you've put in here and I hope I can get you directed towards the new effort. I look forward to any new ideas you can bring to the table. Thank you!

@brosner brosner closed this Mar 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment