Remove usage of colander.timeparse()
function
that did very little, and has been removed in latest colander release
This commit is contained in:
parent
d2629e8925
commit
caec354092
|
@ -56,12 +56,12 @@ class JQueryTime(colander.Time):
|
||||||
]
|
]
|
||||||
for fmt in formats:
|
for fmt in formats:
|
||||||
try:
|
try:
|
||||||
return colander.timeparse(cstruct, fmt)
|
return datetime.datetime.strptime(cstruct, fmt).time()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# re-try first format, for "better" error message
|
# re-try first format, for "better" error message
|
||||||
return colander.timeparse(cstruct, formats[0])
|
return datetime.datetime.strptime(cstruct, formats[0]).time()
|
||||||
|
|
||||||
|
|
||||||
class DateTimeBoolean(colander.Boolean):
|
class DateTimeBoolean(colander.Boolean):
|
||||||
|
|
Loading…
Reference in a new issue