Skip to content

Commit 92122ec

Browse files
committed
fix 'Request' object has no attribute 'tzinfo'
1 parent c584833 commit 92122ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

uliweb_apijson/apijson/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def _conver():
300300
nonlocal v
301301
if v and col.type.python_type==datetime:
302302
_v = v
303-
v = to_datetime(v,tzinfo=request.tzinfo)
303+
v = to_datetime(v,tzinfo=request.tzinfo if (request and hasattr(request,"tzinfo")) else None)
304304
if v==None:
305305
raise UliwebError("'%s' cannot convert to datetime"%(_v))
306306
if c1=='>':

0 commit comments

Comments
 (0)