Compare commits
No commits in common. "666e12253e8f118f1e2067f509dce5d483e8be19" and "dbd8d6bbe36b97d7872e519ca63b95aba3a23152" have entirely different histories.
666e12253e
...
dbd8d6bbe3
@ -59,11 +59,11 @@ def _start():
|
|||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
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)
|
||||||
if not test: return jsonify({'error': 'The exam code you entered is invalid.'}), 400
|
|
||||||
entry.test = test
|
entry.test = test
|
||||||
entry.dataset = test.dataset
|
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 entry.user_code and entry.user_code not in test.adjustments: return jsonify({'error': f'The user code you entered is not valid.'}), 400
|
if entry.user_code and entry.user_code not in test.adjustments: return jsonify({'error': f'The user code you entered is not valid.'}), 400
|
||||||
if test.end_date < datetime.now(): return jsonify({'error': f'The exam code you entered expired on {test["expiry_date"].strftime("%d %b %Y %H:%M")}.'}), 400
|
if test.end_date < datetime.now(): return jsonify({'error': f'The exam code you entered expired on {test["expiry_date"].strftime("%d %b %Y %H:%M")}.'}), 400
|
||||||
if test.start_date > datetime.now(): return jsonify({'error': f'The exam has not yet opened. Your exam code will be valid from {test["start_date"].strftime("%d %b %Y %H:%M")}.'}), 400
|
if test.start_date > datetime.now(): return jsonify({'error': f'The exam has not yet opened. Your exam code will be valid from {test["start_date"].strftime("%d %b %Y %H:%M")}.'}), 400
|
||||||
|
Loading…
Reference in New Issue
Block a user