API client: fix date input
This commit is contained in:
parent
6892b04742
commit
fcdbf515e9
1 changed files with 7 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
''' API client for bocal-site '''
|
''' API client for bocal-site '''
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
@ -91,7 +93,11 @@ def cmd(func):
|
||||||
|
|
||||||
@cmd
|
@cmd
|
||||||
def cmd_publish(token, args):
|
def cmd_publish(token, args):
|
||||||
publish_date = date.today() if not args.date else args.date
|
if not args.date:
|
||||||
|
publish_date = date.today()
|
||||||
|
else:
|
||||||
|
year, month, day = [int(x) for x in args.date.strip().split('-')]
|
||||||
|
publish_date = date(year=year, month=month, day=day)
|
||||||
(ret_code, ret_str) = publish(args.host,
|
(ret_code, ret_str) = publish(args.host,
|
||||||
token,
|
token,
|
||||||
args.numero,
|
args.numero,
|
||||||
|
|
Loading…
Reference in a new issue