Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf3e308d

Browse files
committed
use getattr to make code less
1 parent92122ec commitf3e308d

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
nonlocalv
301301
ifvandcol.type.python_type==datetime:
302302
_v=v
303-
v=to_datetime(v,tzinfo=request.tzinfoif(requestandhasattr(request,"tzinfo"))elseNone)
303+
v=to_datetime(v,tzinfo=getattr(request,"tzinfo",None))
304304
ifv==None:
305305
raiseUliwebError("'%s' cannot convert to datetime"%(_v))
306306
ifc1=='>':

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp