Browse Source

fix: 修复创建/更新远程应用资产可以为空的问题

pull/6671/head
Bai 3 years ago committed by 老广
parent
commit
b7378da46e
  1. 5
      apps/applications/serializers/attrs/application_category/remote_app.py

5
apps/applications/serializers/attrs/application_category/remote_app.py

@ -40,6 +40,11 @@ class RemoteAppSerializer(serializers.Serializer):
max_length=128, label=_('Application path'), allow_null=True max_length=128, label=_('Application path'), allow_null=True
) )
def validate_asset(self, asset):
if not asset:
raise serializers.ValidationError(_('This field is required'))
return asset
@staticmethod @staticmethod
def get_asset_info(obj): def get_asset_info(obj):
asset_id = obj.get('asset') asset_id = obj.get('asset')

Loading…
Cancel
Save