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

« back to all changes in this revision

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

Fix views in ivle.webapp.admin and ivle.webapp.tutorial to return 404 wherever
possible, rather than crashing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    def __init__(self, req, login):
40
40
        super(UserRESTView, self).__init__(self, req, login)
41
41
        self.context = ivle.database.User.get_by_login(req.store, login)
 
42
        if self.context is None:
 
43
            raise NotFound()
42
44
 
43
45
    def GET(self, req):
44
46
        # XXX Check Caps
71
73
 
72
74
    def __init__(self, req, login):
73
75
        self.context = ivle.database.User.get_by_login(req.store, login)
 
76
        if self.context is None:
 
77
            raise NotFound()
74
78
 
75
79
    def populate(self, req, ctx):
76
 
        if not self.context:
77
 
            raise NotFound()
78
 
 
79
80
        self.plugin_scripts[Plugin] = ['settings.js']
80
81
        req.scripts_init = ['revert_settings']
81
82