Sep 14 - Update the check-ins pages to force employee to select the type of work

This commit is contained in:
2026-09-14 12:18:53 -04:00
parent d92cff81e5
commit 4fc500707b
4 changed files with 87 additions and 13 deletions
+12 -1
View File
@@ -743,8 +743,19 @@ def qr_checkin(qr_url):
# The employee enters a numeric ID and picks a work type; the code is
# appended to the ID so the stored value keeps the existing storage
# format ("1234SP") that every calculator and export already parses.
# Empty selection = Regular work — the ID is stored unchanged.
# The dropdown has no default: 'R' = Regular (ID stored unchanged),
# and an empty value means the employee did not choose — rejected.
work_type = request.form.get('work_type', '').strip().upper()
if not work_type:
logger_handler.logger.warning(
f"Check-in rejected: no type of work selected for employee {employee_id}"
)
return jsonify({
'success': False,
'message': 'Please select the Type of Work. / Por favor seleccione el Tipo de Trabajo.'
}), 400
if work_type == 'R':
work_type = '' # Regular — no code appended
if work_type and work_type not in VALID_CHECKIN_WORK_TYPES:
logger_handler.logger.warning(
f"Check-in rejected: invalid work type '{work_type}' for employee {employee_id}"