diff --git a/serve.py b/serve.py index 32ff15b..5e1b686 100755 --- a/serve.py +++ b/serve.py @@ -63,9 +63,12 @@ class Root(object): # --- RESULTS ------------------------------------------------------------ @cherrypy.expose def results(self): - r = self.database.test_grades(self.testconf['ref']) - template = self.templates.get_template('results.html') - return template.render(t=self.testconf, results=r) + if self.testconf.get('practice', False): + r = self.database.test_grades(self.testconf['ref']) + template = self.templates.get_template('results.html') + return template.render(t=self.testconf, results=r) + else: + raise cherrypy.HTTPRedirect('/') # --- TEST --------------------------------------------------------------- @cherrypy.expose -- libgit2 0.21.2