Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
guo xiaoyong
Jumpserver
Commits
5e4502b2
Commit
5e4502b2
authored
3 years ago
by
xinwen
Committed by
老广
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix: 系统用户的账号列表里修改密码后不能登录
parent
173c450b
v2.12
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/assets/tasks/push_system_user.py
+5
-2
apps/assets/tasks/push_system_user.py
with
5 additions
and
2 deletions
+5
-2
apps/assets/tasks/push_system_user.py
+
5
-
2
View file @
5e4502b2
...
...
@@ -4,7 +4,7 @@ from itertools import groupby
from
celery
import
shared_task
from
common.db.utils
import
get_object_if_need
,
get_objects
from
django.utils.translation
import
ugettext
as
_
from
django.db.models
import
Empty
from
django.db.models
import
Empty
,
Q
from
common.utils
import
encrypt_password
,
get_logger
from
assets.models
import
SystemUser
,
Asset
,
AuthBook
...
...
@@ -238,9 +238,12 @@ def push_system_user_util(system_user, assets, task_name, username=None):
no_special_auth
=
[]
special_auth_set
=
set
()
auth_books
=
AuthBook
.
objects
.
filter
(
username__in
=
usernames
,
asset_id__in
=
asset_ids
)
auth_books
=
AuthBook
.
objects
.
filter
(
asset_id__in
=
asset_ids
).
filter
(
Q
(
username__in
=
usernames
)
|
Q
(
systemuser__username__in
=
usernames
)
).
prefetch_related
(
'systemuser'
)
for
auth_book
in
auth_books
:
auth_book
.
load_auth
()
special_auth_set
.
add
((
auth_book
.
username
,
auth_book
.
asset_id
))
for
_username
in
usernames
:
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help