~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to www/dispatch/__init__.py

  • Committer: dcoles
  • Date: 2008-07-16 08:03:42 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:896
Dispatch: Try and get userid from session as early as possible. This is to 
prevent IVLE errors saying with the IVLE frame from saying there is logged in 
user even if a user has already logged in. (At the point in the code when these 
errors - 404 etc. - are triggered IVLE technically doesn't _know_ the user is 
logged in... but we can call the get_user_details to try and view them early)

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
    just used to catch exceptions.
85
85
    Takes both an IVLE request and an Apache req.
86
86
    """
 
87
    # Hack? Try and get the user login early just in case we throw an error
 
88
    # (most likely 404) to stop us seeing not logged in even when we are.
 
89
    req.user = login.get_user_details(req)
 
90
 
87
91
    # Check req.app to see if it is valid. 404 if not.
88
92
    if req.app is not None and req.app not in conf.apps.app_url:
89
93
        # Maybe it is a special app!