Skip to content

Commit

Permalink
Fix appointment date parsing (#7)
Browse files Browse the repository at this point in the history
* Add custom models for Doctor, Patient, and Appointment

* Add URL routing for create_appointment view

* Add URL pattern for list_appointments view

* Add update and delete appointment view functions

* Add URL patterns for update and delete appointment views

* Update docker-compose with correct environment variables

* Update logging configuration

* Fix request data keys in create_appointment and update docker-compose

* Update appointment views

* Fix key retrieval and string parsing for appointment_date

* Add logging for appointment_date_str type

---------

Co-authored-by: staging-devin-ai-integration[bot] <166158716+staging-devin-ai-integration[bot]@users.noreply.github.com>
  • Loading branch information
1 parent aa26436 commit a91dd0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions appointments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ def create_appointment(request):
try:
data = json.loads(request.body)
logger.info(f"Request data: {data}")
doctor_id = data.get('doctor')
patient_id = data.get('patient')
appointment_date = parse_datetime(data.get('scheduled_time'))
doctor_id = data.get('doctor_id')
patient_id = data.get('patient_id')
appointment_date_str = data.get('appointment_date')
logger.info(f"Type of appointment_date_str: {type(appointment_date_str)}")
appointment_date = parse_datetime(appointment_date_str) if appointment_date_str else None
symptoms = data.get('symptoms')

doctor = Doctor.objects.get(id=doctor_id)
Expand Down

0 comments on commit a91dd0e

Please sign in to comment.