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
548d7ef9
Commit
548d7ef9
authored
Feb 09, 2017
by
xiaokong1937@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #13;fix `user` context conflict problem in user-detail page
parent
fe01f925
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
user.py
apps/users/models/user.py
+9
-0
user_detail.html
apps/users/templates/users/user_detail.html
+0
-0
user.py
apps/users/views/user.py
+1
-1
No files found.
apps/users/models/user.py
View file @
548d7ef9
...
...
@@ -62,6 +62,15 @@ class User(AbstractUser):
def
get_absolute_url
(
self
):
return
reverse
(
'users:user-detail'
,
args
=
(
self
.
id
,))
def
is_public_key_valid
(
self
):
"""
Check if the user's ssh public key is valid.
This function is used in base.html.
"""
if
self
.
_public_key
:
return
True
return
False
@property
def
is_expired
(
self
):
if
self
.
date_expired
<
timezone
.
now
():
...
...
apps/users/templates/users/user_detail.html
View file @
548d7ef9
This diff is collapsed.
Click to expand it.
apps/users/views/user.py
View file @
548d7ef9
...
...
@@ -106,7 +106,7 @@ class UserUpdateView(AdminUserRequiredMixin, UpdateView):
class
UserDetailView
(
AdminUserRequiredMixin
,
DetailView
):
model
=
User
template_name
=
'users/user_detail.html'
context_object_name
=
"user"
context_object_name
=
"user
_object
"
def
get_context_data
(
self
,
**
kwargs
):
groups
=
UserGroup
.
objects
.
exclude
(
id__in
=
self
.
object
.
groups
.
all
())
...
...
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