Notes embellished with "published" + current date and time.

2019-08-17
Marnanel Thurman 2019-04-25 20:02:30 +01:00
rodzic 7ab37f84ec
commit 6ae809869b
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -1,5 +1,6 @@
import logging
from django.conf import settings
import datetime
logger = logging.getLogger(name='django_kepi')
@ -25,6 +26,9 @@ def _embellish_Note(thing, user=None):
if 'inReplyTo' not in thing:
thing['inReplyTo'] = None
# XXX Not sure about the 'conversation' tag.
# See https://github.com/tootsuite/mastodon/issues/4213 .
## Content map
if 'contentMap' not in thing and 'content' in thing:
@ -66,7 +70,10 @@ def embellish(thing, user=None):
if 'url' not in thing:
thing['url'] = thing['id']
# XXX 'published' date: format?
if 'published' not in thing:
thing['published'] = datetime.datetime.now().isoformat(
timespec='seconds',
)+'Z'
###### special embellishments per "type"