Monday, March 24, 2014

Django Registration Customization Problem

Hello All,

I want the following registration workflow in my app.
  1. User enters his email and is automatically logged-in to the app. The user can play with the app, and it would logout the user after 30 minutes.
  2. Meanwhile an activation email goes out to user's email that would
    1. Confirm his email address
    2. Redirects the user to a new page where he enters his first/last name and password
  3. User can now login to the app his new password.

To implement this workflow, I customized registration backend(registration.backends.default.DefaultBackend). Specifically, I have override the 'post_activation_redirect' method to redirect the user to his profile update page. Where he enters his name and password and submits data. 

from registration.backends.default import DefaultBackend

class CustomBackend(DefaultBackend):

def post_activation_redirect(self, request, user):
        """
        Return the name of the URL to redirect to after successful
        account activation.
       
        """
        return ('update_user_profile', (user, ), {})

However, the problem is that when user clicks on activation link his email is validated and activation_key expires. Now if user does not fill his profile information at that point in time, the activation link would no longer redirect him to profile update page because the activation key has expired. 

Please advise how to solve this problem.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/af58f0cf-8419-42fb-bebc-fca777c47cfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment