GiPHouse / Website

GiPHouse website based on Django Framework
https://giphouse.nl
GNU Affero General Public License v3.0
5 stars 2 forks source link

Reservations 14 days from today don't show #617

Closed nvoers closed 1 year ago

nvoers commented 1 year ago

Reservations that are made exactly 14 days from now do not show in the calendar after they are made. Probably caused by the 14 day limit on reserving rooms.

1058274 commented 1 year ago

I can confirm after reproducing the bug locally. The reservation is placed correctly, but not shown in the front-end.

The cause is here. Suggested fix:

start_time__date__lt=timezone.now() + self.time_window_future,

to

start_time__date__lte=timezone.now() + self.time_window_future,
1058274 commented 1 year ago

What is the point of having these filter operations when the dates on which reservations can be made are restricted already?

JobDoesburg commented 1 year ago

What is the point of having these filter operations when the dates on which reservations can be made are restricted already?

Otherwise, every time a page is loaded, all reservations ever made will be included (which is very slow)

1058274 commented 1 year ago

What is the point of having these filter operations when the dates on which reservations can be made are restricted already?

Otherwise, every time a page is loaded, all reservations ever made will be included (which is very slow)

Is there also an argument for the other direction (future reservations)?

JobDoesburg commented 1 year ago

What is the point of having these filter operations when the dates on which reservations can be made are restricted already?

Otherwise, every time a page is loaded, all reservations ever made will be included (which is very slow)

Is there also an argument for the other direction (future reservations)?

I don't think so, there are pretty much never any real future reservations

1058274 commented 1 year ago

What is the point of having these filter operations when the dates on which reservations can be made are restricted already?

Otherwise, every time a page is loaded, all reservations ever made will be included (which is very slow)

Is there also an argument for the other direction (future reservations)?

I don't think so, there are pretty much never any real future reservations

In that case, another possible solution is to simply remove the filter condition I refered to earlier, instead of adjusting it.