Commits

Anonymous committed 4f2518b

add default_redirect parameter to dissociate function. close issue #11. Thanks

Comments (0)

Files changed (1)

django_authopenid/views.py

             msg = urllib.quote(_("Password changed"))
             redirect_to = "%s?%s" % (post_change_redirect, 
                                 urllib.urlencode({ "msg": msg }))
-            print redirect_to
             return HttpResponseRedirect(redirect_to)
     else:
         
 @login_required
 def dissociate(request, template_name="authopenid/dissociate.html",
         dissociate_form=OpenidDissociateForm, redirect_field_name=REDIRECT_FIELD_NAME, 
-        extra_context=None):
+        default_redirect=settings.LOGIN_REDIRECT_URL, extra_context=None):
         
     """ view used to dissociate an openid from an account """
     redirect_to = request.REQUEST.get(redirect_field_name, '')
     if not redirect_to or '//' in redirect_to or ' ' in redirect_to:
-        redirect_to = settings.LOGIN_REDIRECT_URL
+        redirect_to = default_redirect
+        
     # get list of associated openids
     rels = UserAssociation.objects.filter(user__id=request.user.id)
     associated_openids = [rel.openid_url for rel in rels]