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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy