Changeset 4117

Show
Ignore:
Timestamp:
02/16/08 06:24:38 (10 months ago)
Author:
faide
Message:

fix a pb when the user has requested the /login page. The current code tried to redirect to forward_url which was None, and provoked an exception.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/turbogears/qstemplates/quickstart/+package+/controllers.py_tmpl

    r4105 r4117  
    5151        if not identity.current.anonymous and identity.was_login_attempted() \ 
    5252            and not identity.get_identity_errors(): 
    53             raise redirect(tg.url(forward_url, kw)) 
     53            if forward_url: 
     54                raise redirect(tg.url(forward_url, kw)) 
     55 
     56            elif previous_url: 
     57                raise redirect(tg.url(previous_url, kw)) 
     58 
     59            else: 
     60                raise redirect(tg.url('/')) 
    5461 
    5562        forward_url = None