From efec599225864ac1f2908cdfbc1201ef503da67c Mon Sep 17 00:00:00 2001 From: viveksantayana Date: Tue, 7 Dec 2021 16:17:59 +0000 Subject: [PATCH] Debug form error handlers --- ref-test/admin/views.py | 2 +- ref-test/quiz/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ref-test/admin/views.py b/ref-test/admin/views.py index 7d7cc19..afe79cd 100644 --- a/ref-test/admin/views.py +++ b/ref-test/admin/views.py @@ -279,7 +279,7 @@ def questions(): filename = store_data_file(upload, default=default) flash(f'Dataset {form.data_file.data.filename} has been uploaded as {filename}.', 'success') return jsonify({ 'success': f'Dataset {form.data_file.data.filename} has been uploaded as {filename}.'}), 200 - errors = [*form.errors] + errors = [*form.data_file.errors] return jsonify({ 'error': errors}), 400 @views.route('/settings/questions/delete/', methods=['POST']) diff --git a/ref-test/quiz/views.py b/ref-test/quiz/views.py index cbd3080..245bbe8 100644 --- a/ref-test/quiz/views.py +++ b/ref-test/quiz/views.py @@ -82,7 +82,7 @@ def start(): '_id': entry['_id'] }), 200 else: - errors = [*form.errors] + errors = [*form.test_code.errors, *form.user_code.errors, *form.first_name.errors, *form.surname.errors, *form.email.errors, *form.club.errors] return jsonify({ 'error': errors}), 400 @views.route('/api/questions/', methods=['POST'])