summaryrefslogtreecommitdiff
path: root/kpov_judge/web
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-11 23:08:52 +0200
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2018-10-11 23:08:52 +0200
commit08a3e2857d1241ec1d908094d7f52e7331f4c738 (patch)
tree082455d4dd7b00b6259ae9aed3f587b959357bf7 /kpov_judge/web
parenteda91c50d7dc25520fabee0bddd334b3d02bdedd (diff)
web: remove duplicate function
Diffstat (limited to 'kpov_judge/web')
-rwxr-xr-xkpov_judge/web/kpov_judge/kpov_judge.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/kpov_judge/web/kpov_judge/kpov_judge.py b/kpov_judge/web/kpov_judge/kpov_judge.py
index 1085b9b..5aa0606 100755
--- a/kpov_judge/web/kpov_judge/kpov_judge.py
+++ b/kpov_judge/web/kpov_judge/kpov_judge.py
@@ -36,9 +36,9 @@ def before_request():
@app.route('/')
-def root():
+@app.route('/classes/')
+def index():
student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody')
- # env = flask.app.request.environ
classes = g.db.classes.find({}, {'class_id': 1, 'name': 1}).sort('class_id')
return render_template('index.html', student_id=student_id, classes=classes)
@@ -46,7 +46,6 @@ def root():
@app.route('/classes/<class_id>/')
def class_tasks(class_id):
student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody')
- # env = flask.app.request.environ
clas = g.db.classes.find_one({'class_id': class_id})
tasks = g.db.tasks.find({'class_id': class_id}, {'task_id': 1}).sort('task_id')
if tasks is not None:
@@ -56,14 +55,6 @@ def class_tasks(class_id):
return render_template('class_tasks.html', student_id=student_id, tasks=task_list, clas=clas)
-@app.route('/classes/')
-def class_list():
- student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody')
- # env = flask.app.request.environ
- classes = g.db.classes.find({}, {'class_id': 1, 'name': 1,}).sort('name')
- return render_template('class_list.html', student_id=student_id, classes=classes)
-
-
def results_post(class_id, task_id, results):
student_id = flask.app.request.environ.get('REMOTE_USER', 'Nobody')
db = g.db