#26653: Make syndication's lastBuildDate timezone aware
-------------------------------------+-------------------------------------
Reporter: didrix | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: contrib.syndication | Version: 1.9
Severity: Normal | Resolution:
Keywords: timezone | Triage Stage: Accepted
syndication lastBuildDate |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):
* needs_better_patch: => 0
* needs_tests: => 1
* easy: 0 => 1
* needs_docs: => 0
* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
I guess a patch might look like:
{{{ #!diff
diff --git a/django/utils/feedgenerator.py b/django/utils/feedgenerator.py
index 3a91af3..2bbc7b8 100644
--- a/django/utils/feedgenerator.py
+++ b/django/utils/feedgenerator.py
@@ -26,7 +26,7 @@ from __future__ import unicode_literals
import datetime
import warnings
-from django.utils import datetime_safe, six
+from django.utils import datetime_safe, six, timezone
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.encoding import force_text, iri_to_uri
from django.utils.six import StringIO
@@ -223,7 +223,7 @@ class SyndicationFeed(object):
if latest_date is None or item_date > latest_date:
latest_date = item_date
- return latest_date or datetime.datetime.now()
+ return latest_date or timezone.now()
class Enclosure(object):
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26653#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.645cb09f493220b33bd8eaeffadd697d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.