Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
周伟奇
/
bmw-ocr
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
ae762243
authored
2022-01-05 19:03:59 +0800
by
周伟奇
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
cancel code review
1 parent
baf48dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
src/apps/account/views.py
src/apps/doc/views.py
src/apps/account/views.py
View file @
ae76224
...
...
@@ -13,15 +13,15 @@ class LoginView(ObtainJSONWebToken, GenericView):
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
# 登录次数限制
user_name
=
request
.
data
.
get
(
'username'
,
''
)
times
=
rh
.
get_login_times
(
user_name
)
if
isinstance
(
times
,
int
)
and
times
>=
LOGIN_TIMES_LIMIT
:
raise
self
.
invalid_params
(
msg
=
"重试次数限制"
)
#
times = rh.get_login_times(user_name)
#
if isinstance(times, int) and times >= LOGIN_TIMES_LIMIT:
#
raise self.invalid_params(msg="重试次数限制")
res
=
super
(
LoginView
,
self
)
.
post
(
request
,
*
args
,
**
kwargs
)
self
.
running_log
.
info
(
'[users.login] username: {0}'
.
format
(
user_name
))
if
res
.
status_code
==
status
.
HTTP_400_BAD_REQUEST
:
rh
.
set_login_times
(
user_name
,
LOGIN_TIMES_LIMIT_EXPIRES
)
#
rh.set_login_times(user_name, LOGIN_TIMES_LIMIT_EXPIRES)
raise
self
.
invalid_params
(
msg
=
"用户名或密码错误"
)
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
# serializer.is_valid()
...
...
src/apps/doc/views.py
View file @
ae76224
...
...
@@ -898,9 +898,9 @@ class DocView(GenericView, DocHandler):
file
.
close
()
os
.
remove
(
tmp_save_path
)
raise
self
.
invalid_params
(
msg
=
'invalid params: not a PDF file'
)
elif
not
self
.
xss_pass
(
file
):
os
.
remove
(
tmp_save_path
)
raise
self
.
invalid_params
(
msg
=
'invalid params: PDF file XSS'
)
#
elif not self.xss_pass(file):
#
os.remove(tmp_save_path)
#
raise self.invalid_params(msg='invalid params: PDF file XSS')
file
.
close
()
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment