Feeds: make RSS valid, part trois.

Hopefully finishes the RSS fix saga. This one done in-house rather
than by patch, as 5d6d4f9ca0 and 29fdc774a9 had been.

This final change ensures the <updated> tag is always used, even
for un-edited posts. This appears to pass the W3C Validator using
local test data. We shall see how it behaves with data on prod.
master
Snakes 2022-05-30 07:24:26 -04:00
parent ddc4fe756e
commit 75758dd511
1 changed files with 4 additions and 4 deletions

View File

@ -48,11 +48,11 @@ def feeds_user(sort='hot', t='all'):
with tag("id"):
text(post.permalink)
if (post.edited_utc):
with tag("updated"):
with tag("updated"):
if (post.edited_utc):
text(datetime.utcfromtimestamp(post.edited_utc).isoformat()+"Z")
else:
text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z")
else:
text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z")
with tag("published"):
text(datetime.utcfromtimestamp(post.created_utc).isoformat()+"Z")