Blindly 'fix' date handling
This commit is contained in:
parent
93707f9800
commit
75890fa76b
7
main.py
7
main.py
|
@ -35,12 +35,12 @@ def application(env, re):
|
|||
return
|
||||
|
||||
count = args["count"][0] if "count" in args and args["count"] else 3
|
||||
date = args["date"][0] if "date" in args and args["date"] else None
|
||||
time = args["time"][0] if "time" in args and args["time"] else None
|
||||
date = args["date"][0] if "date" in args and args["date"] else datetime.datetime.strftime(datetime.datetime.now(),"%d.%m.%Y")
|
||||
time = args["time"][0] if "time" in args and args["time"] else datetime.datetime.strftime(datetime.datetime.now(),"%H:%M")
|
||||
mode = args["mode"][0] if "mode" in args and args["mode"] else None
|
||||
|
||||
try:
|
||||
outtime = datetime.strptime("%s %s" % (date, time), "%d.%m.%Y %H:%M")
|
||||
outtime = datetime.datetime.strptime("%s %s" % (date, time), "%d.%m.%Y %H:%M")
|
||||
except:
|
||||
re("400 Bad Request", [])
|
||||
yield "<h1>400 Bad Request</h1>".encode()
|
||||
|
@ -49,7 +49,6 @@ def application(env, re):
|
|||
|
||||
try:
|
||||
output = workers.conn.worker(frm, to, count, date, time, mode)
|
||||
|
||||
except Exception as e:
|
||||
re("500 Internal Server Error", [])
|
||||
yield "<h1>500 Internal Server Error</h1>".encode()
|
||||
|
|
Loading…
Reference in a new issue