Skip to content

Commit da28251

Browse files
Narrow invalid date parsing exception to ValueError
Agent-Logs-Url: https://github.com/conorheffron/booking-sys/sessions/402a72f4-5db9-4ac5-af9a-ad5dbf2a2632 Co-authored-by: conorheffron <[email protected]>
1 parent 68332ed commit da28251

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

backend/hr/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def bookings_by_id(cls, request, reservation_id):
160160
parsed_reservation_date = datetime.strptime(
161161
reservation_date, "%Y-%m-%d"
162162
).date()
163-
except Exception:
163+
except ValueError:
164164
return JsonResponse(
165165
{"error": "Invalid reservation_date or reservation_slot."},
166166
status=400

0 commit comments

Comments
 (0)