Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
84992746
Commit
84992746
authored
Nov 17, 2015
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
juser/change_info/ fix password can be ignore
parent
4397819b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
views.py
juser/views.py
+3
-3
change_info.html
templates/juser/change_info.html
+2
-2
No files found.
juser/views.py
View file @
84992746
...
...
@@ -433,10 +433,9 @@ def change_info(request):
password
=
request
.
POST
.
get
(
'password'
,
''
)
email
=
request
.
POST
.
get
(
'email'
,
''
)
if
''
in
[
name
,
password
,
email
]:
if
''
in
[
name
,
email
]:
error
=
'不能为空'
if
len
(
password
)
<
6
:
if
len
(
password
)
>
0
and
len
(
password
)
<
6
:
error
=
'密码须大于6位'
if
not
error
:
...
...
@@ -444,6 +443,7 @@ def change_info(request):
# password = CRYPTOR.md5_crypt(password)
User
.
objects
.
filter
(
id
=
user_id
)
.
update
(
name
=
name
,
email
=
email
)
if
len
(
password
)
>
0
:
user
.
set_password
(
password
)
user
.
save
()
msg
=
'修改成功'
...
...
templates/juser/change_info.html
View file @
84992746
...
...
@@ -41,7 +41,7 @@
</div>
<div
class=
"hr-line-dashed"
></div>
<div
class=
"form-group"
>
<label
for=
"password"
class=
"col-sm-2 control-label"
>
密码
<
span
class=
"red-fonts"
>
*
</span><
/label>
<label
for=
"password"
class=
"col-sm-2 control-label"
>
密码
</label>
<div
class=
"col-sm-8"
>
<input
id=
"password"
name=
"password"
placeholder=
"Password"
type=
"password"
class=
"form-control"
>
<span
class=
"help-block m-b-none"
>
...
...
@@ -91,7 +91,7 @@ $('#userForm').validator({
fields
:
{
"password"
:
{
rule
:
"
required;
length[6~50]"
,
rule
:
"length[6~50]"
,
tip
:
"输入密码"
,
ok
:
""
,
msg
:
{
required
:
"必须填写!"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment