Debug form error handlers

This commit is contained in:
Vivek Santayana 2021-12-07 16:17:59 +00:00
parent 7ff786c6e2
commit 6be20568a8
2 changed files with 2 additions and 2 deletions

View File

@ -279,7 +279,7 @@ def questions():
filename = store_data_file(upload, default=default) filename = store_data_file(upload, default=default)
flash(f'Dataset {form.data_file.data.filename} has been uploaded as {filename}.', 'success') 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 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 return jsonify({ 'error': errors}), 400
@views.route('/settings/questions/delete/', methods=['POST']) @views.route('/settings/questions/delete/', methods=['POST'])

View File

@ -82,7 +82,7 @@ def start():
'_id': entry['_id'] '_id': entry['_id']
}), 200 }), 200
else: 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 return jsonify({ 'error': errors}), 400
@views.route('/api/questions/', methods=['POST']) @views.route('/api/questions/', methods=['POST'])