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
2d3a37b4
Commit
2d3a37b4
authored
Aug 09, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_beta' of github.com:jumpserver/jumpserver into dev_beta
parents
2693d68e
8074e669
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
signals_handler.py
apps/assets/signals_handler.py
+1
-0
user.py
apps/users/models/user.py
+7
-8
No files found.
apps/assets/signals_handler.py
View file @
2d3a37b4
...
@@ -112,6 +112,7 @@ def on_node_assets_changed(sender, instance=None, **kwargs):
...
@@ -112,6 +112,7 @@ def on_node_assets_changed(sender, instance=None, **kwargs):
@receiver
(
post_save
,
sender
=
Node
)
@receiver
(
post_save
,
sender
=
Node
)
def
on_node_update_or_created
(
sender
,
instance
=
None
,
created
=
False
,
**
kwargs
):
def
on_node_update_or_created
(
sender
,
instance
=
None
,
created
=
False
,
**
kwargs
):
if
instance
and
not
created
:
if
instance
and
not
created
:
Asset
.
expire_all_nodes_keys_cache
()
instance
.
expire_full_value
()
instance
.
expire_full_value
()
...
...
apps/users/models/user.py
View file @
2d3a37b4
...
@@ -207,20 +207,19 @@ class TokenMixin:
...
@@ -207,20 +207,19 @@ class TokenMixin:
@property
@property
def
private_token
(
self
):
def
private_token
(
self
):
from
authentication.models
import
PrivateToken
return
self
.
create_private_token
()
try
:
token
=
PrivateToken
.
objects
.
get
(
user
=
self
)
except
PrivateToken
.
DoesNotExist
:
token
=
self
.
create_private_token
()
return
token
def
create_private_token
(
self
):
def
create_private_token
(
self
):
from
authentication.models
import
PrivateToken
from
authentication.models
import
PrivateToken
token
=
PrivateToken
.
objects
.
create
(
user
=
self
)
token
,
created
=
PrivateToken
.
objects
.
get_or_
create
(
user
=
self
)
return
token
return
token
def
delete_private_token
(
self
):
from
authentication.models
import
PrivateToken
PrivateToken
.
objects
.
filter
(
user
=
self
)
.
delete
()
def
refresh_private_token
(
self
):
def
refresh_private_token
(
self
):
self
.
private_token
.
delete
()
self
.
delete_private_token
()
return
self
.
create_private_token
()
return
self
.
create_private_token
()
def
create_bearer_token
(
self
,
request
=
None
):
def
create_bearer_token
(
self
,
request
=
None
):
...
...
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