Compare commits
2 Commits
ba851cb7dc
...
8013a776a9
Author | SHA1 | Date | |
---|---|---|---|
8013a776a9 | |||
aa1f46ee62 |
@ -59,11 +59,11 @@ def _start():
|
||||
except Exception as exception:
|
||||
write('system.log', f'Database error when processing request \'{request.url}\': {exception}')
|
||||
return abort(500)
|
||||
if not test: return jsonify({'error': 'The exam code you entered is invalid.'}), 400
|
||||
entry.test = test
|
||||
entry.dataset = test.dataset
|
||||
entry.user_code = request.form.get('user_code')
|
||||
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 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
|
||||
|
Loading…
Reference in New Issue
Block a user