feat: 推送动态系统用户,系统上用户的 comment 字段是 userdisplayname

pull/5690/head
xinwen 2021-03-04 10:31:15 +08:00 committed by 老广
parent 78bf6f5817
commit ab23a357f7
1 changed files with 9 additions and 1 deletions

View File

@ -32,11 +32,19 @@ def _dump_args(args: dict):
def get_push_unixlike_system_user_tasks(system_user, username=None): def get_push_unixlike_system_user_tasks(system_user, username=None):
comment = system_user.name
if username is None: if username is None:
username = system_user.username 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 password = system_user.password
public_key = system_user.public_key public_key = system_user.public_key
comment = system_user.name
groups = _split_by_comma(system_user.system_groups) groups = _split_by_comma(system_user.system_groups)