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
bf9a2714
Commit
bf9a2714
authored
6 years ago
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bugfix' of github.com:jumpserver/jumpserver into bugfix
parents
29824fb7
3598bc79
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
14 deletions
+16
-14
jumpserver.js
apps/static/js/jumpserver.js
+1
-1
forms.py
apps/users/forms.py
+15
-0
user.py
apps/users/views/user.py
+0
-13
No files found.
apps/static/js/jumpserver.js
View file @
bf9a2714
...
@@ -472,7 +472,7 @@ jumpserver.initDataTable = function (options) {
...
@@ -472,7 +472,7 @@ jumpserver.initDataTable = function (options) {
};
};
var
table
=
ele
.
DataTable
({
var
table
=
ele
.
DataTable
({
pageLength
:
options
.
pageLength
||
15
,
pageLength
:
options
.
pageLength
||
15
,
dom
:
options
.
dom
||
'<"#uc.pull-left">
flt
<"row m-t"<"col-md-8"<"#op.col-md-6"><"col-md-6 text-center"i>><"col-md-4"p>>'
,
dom
:
options
.
dom
||
'<"#uc.pull-left">
<"pull-right"<"inline"l><"#fb.inline"><"inline"f><"#fa.inline">>tr
<"row m-t"<"col-md-8"<"#op.col-md-6"><"col-md-6 text-center"i>><"col-md-4"p>>'
,
order
:
options
.
order
||
[],
order
:
options
.
order
||
[],
// select: options.select || 'multi',
// select: options.select || 'multi',
searchDelay
:
800
,
searchDelay
:
800
,
...
...
This diff is collapsed.
Click to expand it.
apps/users/forms.py
View file @
bf9a2714
...
@@ -7,6 +7,7 @@ from common.utils import validate_ssh_public_key
...
@@ -7,6 +7,7 @@ from common.utils import validate_ssh_public_key
from
orgs.mixins
import
OrgModelForm
from
orgs.mixins
import
OrgModelForm
from
orgs.utils
import
current_org
from
orgs.utils
import
current_org
from
.models
import
User
,
UserGroup
from
.models
import
User
,
UserGroup
from
.utils
import
check_password_rules
class
UserCheckPasswordForm
(
forms
.
Form
):
class
UserCheckPasswordForm
(
forms
.
Form
):
...
@@ -90,6 +91,20 @@ class UserCreateUpdateFormMixin(OrgModelForm):
...
@@ -90,6 +91,20 @@ class UserCreateUpdateFormMixin(OrgModelForm):
raise
forms
.
ValidationError
(
_
(
'Not a valid ssh public key'
))
raise
forms
.
ValidationError
(
_
(
'Not a valid ssh public key'
))
return
public_key
return
public_key
def
clean_password
(
self
):
password_strategy
=
self
.
data
.
get
(
'password_strategy'
)
# 创建-不设置密码
if
password_strategy
==
'0'
:
return
password
=
self
.
data
.
get
(
'password'
)
# 更新-密码为空
if
password_strategy
is
None
and
not
password
:
return
if
not
check_password_rules
(
password
):
msg
=
_
(
'* Your password does not meet the requirements'
)
raise
forms
.
ValidationError
(
msg
)
return
password
def
save
(
self
,
commit
=
True
):
def
save
(
self
,
commit
=
True
):
password
=
self
.
cleaned_data
.
get
(
'password'
)
password
=
self
.
cleaned_data
.
get
(
'password'
)
otp_level
=
self
.
cleaned_data
.
get
(
'otp_level'
)
otp_level
=
self
.
cleaned_data
.
get
(
'otp_level'
)
...
...
This diff is collapsed.
Click to expand it.
apps/users/views/user.py
View file @
bf9a2714
...
@@ -133,19 +133,6 @@ class UserUpdateView(PermissionsMixin, SuccessMessageMixin, UpdateView):
...
@@ -133,19 +133,6 @@ class UserUpdateView(PermissionsMixin, SuccessMessageMixin, UpdateView):
kwargs
.
update
(
context
)
kwargs
.
update
(
context
)
return
super
()
.
get_context_data
(
**
kwargs
)
return
super
()
.
get_context_data
(
**
kwargs
)
def
form_valid
(
self
,
form
):
password
=
form
.
cleaned_data
.
get
(
'password'
)
if
not
password
:
return
super
()
.
form_valid
(
form
)
is_ok
=
check_password_rules
(
password
)
if
not
is_ok
:
form
.
add_error
(
"password"
,
_
(
"* Your password does not meet the requirements"
)
)
return
self
.
form_invalid
(
form
)
return
super
()
.
form_valid
(
form
)
def
get_form_kwargs
(
self
):
def
get_form_kwargs
(
self
):
kwargs
=
super
(
UserUpdateView
,
self
)
.
get_form_kwargs
()
kwargs
=
super
(
UserUpdateView
,
self
)
.
get_form_kwargs
()
data
=
{
'request'
:
self
.
request
}
data
=
{
'request'
:
self
.
request
}
...
...
This diff is collapsed.
Click to expand it.
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