emencia / django-blog-lotus

A weblog application with Django.
https://django-blog-lotus.readthedocs.io/
MIT License
5 stars 1 forks source link

Publish time usage implementation in queryset may result to empty queryset #22

Closed sveetch closed 2 years ago

sveetch commented 2 years ago

Usage of "publish_time" field in BasePublishedQuerySet.get_published (and get_unpublished) may sometime returns an empty queryset.

It does not happen in tests since we forced a fixed neutral datetime, it is only reproducible for now on frontend when running development server.

This is often raised during night around after midgnight. This is likely to be caused by the fact we use a combination of a date field and a time field which are not technically the same thing that a singular datetime in a queryset.

First thing it to create an unittest to reproduce this wrong behavior in test environment, then fix it.

sveetch commented 2 years ago

The better way to fix would be to get back to a datetime but for now i don't even remember why did i splitted this to distinct date and time fields and so i don't see what the migration would involve..