widelands / widelands-website

The widelands website is a bunch of applications for the django web framework. It is developed in the open here.
https://www.widelands.org/
GNU General Public License v2.0
15 stars 11 forks source link

Feeds have trouble with time when changing from CEST to CET #430

Open frankystone opened 1 year ago

frankystone commented 1 year ago

The problem occurs if a topic or post get added between 2 and 3 o'clock, the time the change from summertime to normal time happens. The error says e.g.:

AmbiguousTimeError at /forum/feeds/topics/5/
2023-10-29 02:43:19

I have solved the error now by changing the time of those posts/topics by adding one hour.

frankystone commented 1 year ago

Traceback:

File "..../site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "..../site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File ".../site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File ".../site-packages/django/contrib/syndication/views.py" in __call__
  39.         feedgen = self.get_feed(obj, request)

File ".../site-packages/django/contrib/syndication/views.py" in get_feed
  199.                 updateddate = make_aware(updateddate, tz)

File ".../site-packages/django/utils/timezone.py" in make_aware
  270.         return timezone.localize(value, is_dst=is_dst)

File ".../site-packages/pytz/tzinfo.py" in localize
  363.             raise AmbiguousTimeError(dt)

Exception Type: AmbiguousTimeError at /forum/feeds/topics/5/
Exception Value: 2023-10-29 02:43:19