From 8010bdecea261db958ec47a1b48152570afab282 Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Fri, 14 May 2021 00:17:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BA=86home=E7=9B=AE=E5=BD=95=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E5=BE=97=E6=89=80=E6=9C=89=E6=8E=A8=E9=80=81=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=85=B1=E7=94=A8=E5=90=8C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?home=E7=9B=AE=E5=BD=95=EF=BC=8C=E5=AF=BC=E8=87=B4=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=9D=83=E9=99=90=E5=8F=AA=E9=99=90=E5=88=B6=E5=9C=A8?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E4=B8=AA=E6=8E=A8=E9=80=81=E7=9A=84=E7=94=A8?= =?UTF-8?q?=E6=88=B7=EF=BC=8C=E5=85=B6=E4=BB=96=E7=94=A8=E6=88=B7=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=8F=AF=E8=BF=9E=E6=8E=A5=E6=80=A7=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=97=B6=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/serializers/system_user.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/assets/serializers/system_user.py b/apps/assets/serializers/system_user.py index e1ada114d..7f5befaed 100644 --- a/apps/assets/serializers/system_user.py +++ b/apps/assets/serializers/system_user.py @@ -103,6 +103,12 @@ class SystemUserSerializer(AuthSerializerMixin, BulkOrgResourceModelSerializer): raise serializers.ValidationError(msg) return username + def validate_home(self, home): + username_same_with_user = self.initial_data.get("username_same_with_user") + if username_same_with_user: + return '' + return home + def validate_sftp_root(self, value): if value in ['home', 'tmp']: return value