implement posting in the past with published flag
This commit is contained in:
parent
7a0ecf31f0
commit
dc40d4df69
|
@ -7,6 +7,8 @@ import giteapy
|
||||||
import giteapy.rest
|
import giteapy.rest
|
||||||
import time
|
import time
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
|
|
||||||
from werkzeug.datastructures import FileStorage
|
from werkzeug.datastructures import FileStorage
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -321,6 +323,12 @@ def process_json_post():
|
||||||
props = body['properties']
|
props = body['properties']
|
||||||
entry_type = detect_entry_type(props)
|
entry_type = detect_entry_type(props)
|
||||||
|
|
||||||
|
if 'published' in props:
|
||||||
|
|
||||||
|
from dateutil import parser
|
||||||
|
|
||||||
|
now = parser.parse(props['published'][0])
|
||||||
|
else:
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
|
||||||
frontmatter, file_path = init_frontmatter(now, entry_type, props.get('name'))
|
frontmatter, file_path = init_frontmatter(now, entry_type, props.get('name'))
|
||||||
|
|
Loading…
Reference in New Issue