Django Admin NonExistentTimeError in date_hierarchy

I just got an error in Django Admin. This is a locally playable log:

NonExistentTimeError at /admin/{blah}/
2015-10-18 00:00:00
Request Method: GET Request
URL:    http://127.0.0.1:8000/admin/{blah}/?q=someuser%40hotmail.com
Django Version: 1.7.10
Exception Type: NonExistentTimeError
Exception Value:     2015-10-18 00:00:00 Exception
Location:   C:\Python27\lib\site-packages\pytz\tzinfo.py in localize,
line 327 Python Executable: C:\Python27\python.exe Python
Version:    2.7.10

I found that it really 2015-10-18 00:00:00does not exist in my time zone ("America / Sao_Paulo") because it happened when the summer savings began.

I use date_hierarchy = 'date_lastupdated', and when I searched in admin for a user, someuser@hotmail.comDjango returns only one record, and this user date_lastupdated- '2015-10-18 05:10:18.593336-03'.

Error in pattern ~~~~/Python27/lib/site-packages/grappelli/templates/admin/change_list.htmlon line 212:

<!-- DATE HIERARCHY -->
    {% block date_hierarchy %}
        {% if cl.date_hierarchy %}{% date_hierarchy cl %}{% endif %}
    {% endblock %}

So, Grappelli is trying to build only one time associated with fractional communication in the admin list, but does not work

I was able to play it on two machines (Linux and Windows), I updated PYTZ. Still happening in versions 2015.4 and 2015.6.

Is this a known issue?

+4
1

, . , . :

http://www.ilian.io/django-pytz-nonexistenttimeerror-and-ambiguoustimeerror/

env:

/myenv/lib/python2.7/site-packages/django/db/models/sql/compiler.py

1145 (, ).

.

, , , .

0

Source: https://habr.com/ru/post/1612940/


All Articles