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 '''
|
||||
|
||||
import json
|
||||
|
@ -91,7 +93,11 @@ def cmd(func):
|
|||
|
||||
@cmd
|
||||
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,
|
||||
token,
|
||||
args.numero,
|
||||
|
|
Loading…
Reference in a new issue