mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-08-28 11:01:13 +00:00
fix: sftp不能设置为默认存储 (#12213)
Co-authored-by: wangruidong <940853815@qq.com>
This commit is contained in:
parent
01e40fd238
commit
d2498c0d53
@ -281,3 +281,10 @@ class ReplayStorageSerializer(BaseStorageSerializer):
|
||||
extra_kwargs = {
|
||||
'name': {'validators': [UniqueValidator(queryset=ReplayStorage.objects.all())]}
|
||||
}
|
||||
|
||||
def validate_is_default(self, value):
|
||||
if self.initial_data.get('type') == const.ReplayStorageType.sftp.value:
|
||||
# sftp不能设置为默认存储
|
||||
return False
|
||||
else:
|
||||
return value
|
||||
|
Loading…
Reference in New Issue
Block a user