From e802e145afe413c843b756fc65258aeb6ad4ddd3 Mon Sep 17 00:00:00 2001 From: wangruidong <940853815@qq.com> Date: Tue, 18 Mar 2025 16:20:58 +0800 Subject: [PATCH] fix: Create ssh_key failed --- apps/users/models/user/_auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/users/models/user/_auth.py b/apps/users/models/user/_auth.py index c5d15a90f..e8d4b31ee 100644 --- a/apps/users/models/user/_auth.py +++ b/apps/users/models/user/_auth.py @@ -137,8 +137,8 @@ class AuthMixin: if self.can_update_ssh_key(): from authentication.models import SSHKey SSHKey.objects.create( - public_key=public_key, private_key=private_key, user=self, name=kwargs.get('name'), - comment=kwargs.get('comment'), is_active=kwargs.get('is_active') + public_key=public_key, private_key=private_key, user=self, name=kwargs.get('name', ''), + comment=kwargs.get('comment', ''), is_active=kwargs.get('is_active') ) post_user_change_password.send(self.__class__, user=self)