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

« back to all changes in this revision

Viewing changes to ivle/dispatch/__init__.py

  • Committer: William Grant
  • Date: 2009-03-26 05:33:03 UTC
  • mto: (1165.3.1 submissions)
  • mto: This revision was merged to the branch mainline in revision 1174.
  • Revision ID: grantw@unimelb.edu.au-20090326053303-t1wsjswhk2sl2gml
Start a submission UI in ivle.webapp.submit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
                return req.OK
129
129
            else:
130
130
                return e.code
 
131
        except mod_python.apache.SERVER_RETURN:
 
132
            # A mod_python-specific Apache error.
 
133
            # XXX: We need to raise these because req.throw_error() uses them.
 
134
            # Remove this after Google Code issue 117 is fixed.
 
135
            raise
131
136
        except Exception, e:
132
137
            # A non-HTTPError appeared. We have an unknown exception. Panic.
133
138
            handle_unknown_exception(req, *sys.exc_info())
166
171
        login = req.user.login
167
172
    except AttributeError:
168
173
        login = None
169
 
    try:
170
 
        role = req.user.role
171
 
    except AttributeError:
172
 
        role = None
173
174
 
174
175
    # Log File
175
176
    try:
215
216
 
216
217
    # Error messages are only displayed is the user is NOT a student,
217
218
    # or if there has been a problem logging the error message
218
 
    show_errors = (not publicmode) and ((login and \
219
 
                        str(role) != "student") or logfail)
 
219
    show_errors = (not publicmode) and ((login and req.user.admin) or logfail)
220
220
    req.write("""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"                 
221
221
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">                                      
222
222
<html xmlns="http://www.w3.org/1999/xhtml">