fix: sftp不能设置为默认存储

pull/12217/head
wangruidong 2023-11-28 15:07:17 +08:00 committed by 老广
parent 24987c7f60
commit b10ee436e8
1 changed files with 7 additions and 0 deletions

View File

@ -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