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