Add dataset to entry on creation

This commit is contained in:
Vivek Santayana 2023-03-04 18:56:10 +00:00
parent 07fb170656
commit 1026cc71a9

View File

@ -60,6 +60,7 @@ def _start():
write('system.log', f'Database error when processing request \'{request.url}\': {exception}') write('system.log', f'Database error when processing request \'{request.url}\': {exception}')
return abort(500) return abort(500)
entry.test = test entry.test = test
entry.dataset = test.dataset
entry.user_code = request.form.get('user_code') entry.user_code = request.form.get('user_code')
entry.user_code = None if entry.user_code == '' else entry.user_code.lower() entry.user_code = None if entry.user_code == '' else entry.user_code.lower()
if not test: return jsonify({'error': 'The exam code you entered is invalid.'}), 400 if not test: return jsonify({'error': 'The exam code you entered is invalid.'}), 400