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

« back to all changes in this revision

Viewing changes to ivle/webapp/admin/user.py

  • Committer: Matt Giuca
  • Date: 2010-02-11 05:54:03 UTC
  • Revision ID: matt.giuca@gmail.com-20100211055403-5eu5f15fu8eg1p6u
ivle/webapp/admin/user.py: Fixed crash when visiting admin-only user pages while logged out (None dereference).

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    breadcrumb_text = 'Users'
40
40
 
41
41
    def authorize(self, req):
42
 
        return req.user.admin
 
42
        return req.user and req.user.admin
43
43
 
44
44
    def populate(self, req, ctx):
45
45
        ctx['req'] = req
127
127
 
128
128
    def authorize(self, req):
129
129
        """Only allow access if the requesting user is an admin."""
130
 
        return req.user.admin
 
130
        return req.user and req.user.admin
131
131
 
132
132
    def filter(self, stream, ctx):
133
133
        return stream | HTMLFormFiller(data=ctx['data'])
212
212
 
213
213
    def authorize(self, req):
214
214
        """Only allow access if the requesting user is an admin."""
215
 
        return req.user.admin
 
215
        return req.user and req.user.admin
216
216
 
217
217
    def populate(self, req, ctx):
218
218
        error = None