adamspd / django-appointment

A Django app for managing appointment scheduling with ease and flexibility.
Apache License 2.0
125 stars 37 forks source link

Finished appoinentrequest, but cannot create an appoinement #239

Closed elcolie closed 1 week ago

elcolie commented 3 weeks ago

image Finish button become disabled and appointmentrequest instance is created. But how to create the appoinetment?

I have watched youtube in the document, but it skipped the process of making appointment.

Question: What to do next in order to create appointment?

adamspd commented 3 weeks ago

Hi @elcolie, I'm not entirely sure why it isn't working in your specific case, but it might be related to the type of characters being used. I tested the latest version of the project locally, and the results are shown below. Could you please try using Latin characters to see if that resolves the issue?

image
elcolie commented 3 weeks ago

It is not related to character. I can click Finish button. But the problem is. After click I got AppointmentRequest instance in the database, but Appointment is not made.

adamspd commented 3 weeks ago

Oh, okay, I did not understand the issue then. How so ?

You don't have any errors ? Can you provide screenshots ?

elcolie commented 3 weeks ago

Screenshot is just that. After I click the button. AppointmentRequest is created. Then button become disable.

adamspd commented 3 weeks ago

Try running it with docker to see if you have the same behaviour. It is described here.

elcolie commented 3 weeks ago

@adamspd I got the same error. Even use your Docker. After click Finish. I got AppointmentRequest created, but Appointment is not.

elcolie commented 3 weeks ago

@adamspd

image

Live Demo also stuck when I click Finish too.

adamspd commented 3 weeks ago

I'll look into it and try to figure out why, thank you for pointing that out.

adamspd commented 3 weeks ago

Hi @elcolie, after a few tests, I saw that the demo website is not working properly due to a django_q configuration issue. It gets the appointment and all, but once in the sending email steps, it slows down and encounters timeouts to finally show a 502 error. It also looks like some migrations aren't applied correctly by the automated script that restores the database every 2 hours. I've taken the site offline while I work on fixing this. There's a good chance the same problem could pop up when using the package in other projects if django_q isn't configured correctly (although it works with the settings in the project locally). Once I've nailed down the exact cause and solution, I'll update both the documentation and this issue with all the details if needed.

elcolie commented 3 weeks ago

Why don't you try using Celery. You can follow the setup example from Django CookieCutter.

adamspd commented 1 week ago

Hi @elcolie, I'd love to use it, but due to time and other requirements I won't be able to add this feature soon.

I finally found the problem with the demo website, it was not because of the package, although I added a new feature in #253 where Django-Q is not a requirement any more (at least you don't have to install it if you're not using it). The problem was that I use an email server to send email when a user tries the demo so they can see what it looks like. The configuration on the server was replaced by my local configuration, thus, the timeout.

When you try the package locally, make sure that the settings in appointments/settings.py is correct for you. Some of the configuration may cause the package to not work if your setup is different.

adamspd commented 1 week ago

Feel free to close this issue.

elcolie commented 1 week ago

On your demo site. image I haven't been redirected to any page. I still on the same page.

Then I try your docker compose. Commit 583c16b5a27caea28558e041f9e51015703b3779 Result is the same. After click, I still sit in the same page. Here is terminal of docker.

web-1       | [02/Sep/2024 09:12:26] INFO appointment.views:appointment_request_submit:245 - date_f 2024-09-14 start_time 15:00:00 end_time 16:00:00 service ปรึกษาการหางาน staff admin
web-1       | [02/Sep/2024 09:12:26] "POST /en/request-submit/ HTTP/1.1" 302 0
web-1       | [02/Sep/2024 09:12:26] "GET /en/client-info/3/1725268346465834127767ed12e3e41e8958596af489b103a/ HTTP/1.1" 200 18445
web-1       | [02/Sep/2024 09:12:34] "POST /en/client-info/3/1725268346465834127767ed12e3e41e8958596af489b103a/ HTTP/1.1" 200 18645

And appointment table is blank.

adamspd commented 1 week ago

Hi @elcolie, I'm completely at a loss. I just tried the demo site, and it works fine as expected. I'd love to understand why it's not working for you. Email me at vhmnk@adamspierredavid.com, and we'll set something up quickly so I can have a look at your issue.

adamspd commented 1 week ago

Just to clarify, have you updated the settings.py file to include the correct configuration for Docker Compose ? This step is essential for it to work properly. I realize this might not be immediately clear, so I'm considering adding a new PR with additional warnings and guidance for the correct configuration when using the project locally.

elcolie commented 1 week ago

@adamspd Thank you for your kindness. I have sent out my email which contains my video log to help you investigate my issue. I will close this issue when we found the root cause.

elcolie commented 1 week ago

Run it without docker-compose it works.