From 08a3e2857d1241ec1d908094d7f52e7331f4c738 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 11 Oct 2018 23:08:52 +0200 Subject: web: remove duplicate function --- kpov_judge/web/kpov_judge/kpov_judge.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'kpov_judge/web') 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//') 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 -- cgit v1.2.1