From ab23a357f7d85ef1076fe14b482d98eae7baaabe Mon Sep 17 00:00:00 2001 From: xinwen Date: Thu, 4 Mar 2021 10:31:15 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=8E=A8=E9=80=81=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=EF=BC=8C=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E4=B8=8A=E7=94=A8=E6=88=B7=E7=9A=84=20comment=20=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=98=AF=20userdisplayname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/tasks/push_system_user.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/assets/tasks/push_system_user.py b/apps/assets/tasks/push_system_user.py index 7506d1fe2..be337baea 100644 --- a/apps/assets/tasks/push_system_user.py +++ b/apps/assets/tasks/push_system_user.py @@ -32,11 +32,19 @@ def _dump_args(args: dict): def get_push_unixlike_system_user_tasks(system_user, username=None): + comment = system_user.name + if username is None: username = system_user.username + + if system_user.username_same_with_user: + from users.models import User + user = User.objects.filter(username=username).only('name', 'username').first() + if user: + comment = f'{system_user.name}[{str(user)}]' + password = system_user.password public_key = system_user.public_key - comment = system_user.name groups = _split_by_comma(system_user.system_groups)