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
292179d4
Commit
292179d4
authored
Sep 09, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system-user
parent
a89ae94d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
models.py
apps/assets/models.py
+0
-1
views.py
apps/assets/views.py
+18
-3
No files found.
apps/assets/models.py
View file @
292179d4
...
@@ -132,7 +132,6 @@ class AdminUser(models.Model):
...
@@ -132,7 +132,6 @@ class AdminUser(models.Model):
class
SystemUser
(
models
.
Model
):
class
SystemUser
(
models
.
Model
):
PROTOCOL_CHOICES
=
(
PROTOCOL_CHOICES
=
(
(
'ssh'
,
'ssh'
),
(
'ssh'
,
'ssh'
),
(
'telnet'
,
'telnet'
),
)
)
name
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
'Name'
))
name
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
_
(
'Name'
))
username
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
_
(
'Username'
))
username
=
models
.
CharField
(
max_length
=
16
,
verbose_name
=
_
(
'Username'
))
...
...
apps/assets/views.py
View file @
292179d4
...
@@ -305,7 +305,7 @@ class SystemUserListView(AdminUserRequiredMixin, ListView):
...
@@ -305,7 +305,7 @@ class SystemUserListView(AdminUserRequiredMixin, ListView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
context
=
{
'app'
:
_
(
'Assets'
),
'app'
:
_
(
'Assets'
),
'action'
:
_
(
'
Admin
user list'
),
'action'
:
_
(
'
System
user list'
),
'keyword'
:
self
.
request
.
GET
.
get
(
'keyword'
,
''
)
'keyword'
:
self
.
request
.
GET
.
get
(
'keyword'
,
''
)
}
}
kwargs
.
update
(
context
)
kwargs
.
update
(
context
)
...
@@ -348,8 +348,23 @@ class SystemUserCreateView(AdminUserRequiredMixin, SuccessMessageMixin, CreateVi
...
@@ -348,8 +348,23 @@ class SystemUserCreateView(AdminUserRequiredMixin, SuccessMessageMixin, CreateVi
)
)
class
SystemUserUpdateView
(
UpdateView
):
class
SystemUserUpdateView
(
AdminUserRequiredMixin
,
UpdateView
):
pass
model
=
SystemUser
form_class
=
SystemUserForm
template_name
=
'assets/system_user_create_update.html'
success_message
=
_
(
'Update system user <a href="
%
s">
%
s</a> successfully.'
)
def
get_context_data
(
self
,
**
kwargs
):
context
=
{
'app'
:
'assets'
,
'action'
:
'Update system user'
}
kwargs
.
update
(
context
)
return
super
(
SystemUserUpdateView
,
self
)
.
get_context_data
(
**
kwargs
)
def
get_success_url
(
self
):
success_url
=
reverse_lazy
(
'assets:system-user-detail'
,
pk
=
self
.
object
.
pk
)
return
success_url
class
SystemUserDetailView
(
DetailView
):
class
SystemUserDetailView
(
DetailView
):
...
...
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