Browse Source

fix: 修复推送动态用户 comment 中包含空格导致推送失败的问题

pull/8373/head
Jiangjie.Bai 2 years ago committed by Jiangjie.Bai
parent
commit
3755f8f33a
  1. 3
      apps/assets/tasks/push_system_user.py

3
apps/assets/tasks/push_system_user.py

@ -33,16 +33,17 @@ def _dump_args(args: dict):
def get_push_unixlike_system_user_tasks(system_user, username=None, **kwargs): def get_push_unixlike_system_user_tasks(system_user, username=None, **kwargs):
comment = system_user.name
algorithm = kwargs.get('algorithm') algorithm = kwargs.get('algorithm')
if username is None: if username is None:
username = system_user.username username = system_user.username
comment = system_user.name
if system_user.username_same_with_user: if system_user.username_same_with_user:
from users.models import User from users.models import User
user = User.objects.filter(username=username).only('name', 'username').first() user = User.objects.filter(username=username).only('name', 'username').first()
if user: if user:
comment = f'{system_user.name}[{str(user)}]' comment = f'{system_user.name}[{str(user)}]'
comment = comment.replace(' ', '')
password = system_user.password password = system_user.password
public_key = system_user.public_key public_key = system_user.public_key

Loading…
Cancel
Save