Browse Source

fix: 修复远程应用资产必填项

pull/6692/head
Bai 3 years ago committed by 老广
parent
commit
9660e20176
  1. 4
      apps/applications/serializers/attrs/application_category/remote_app.py
  2. BIN
      apps/locale/zh/LC_MESSAGES/django.mo
  3. 4
      apps/locale/zh/LC_MESSAGES/django.po

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

@ -34,7 +34,7 @@ class ExistAssetPrimaryKeyRelatedField(serializers.PrimaryKeyRelatedField):
class RemoteAppSerializer(serializers.Serializer):
asset_info = serializers.SerializerMethodField()
asset = ExistAssetPrimaryKeyRelatedField(
queryset=Asset.objects, required=False, label=_("Asset"), allow_null=True
queryset=Asset.objects, required=True, label=_("Asset"), allow_null=True
)
path = serializers.CharField(
max_length=128, label=_('Application path'), allow_null=True
@ -42,7 +42,7 @@ class RemoteAppSerializer(serializers.Serializer):
def validate_asset(self, asset):
if not asset:
raise serializers.ValidationError(_('This field is required'))
raise serializers.ValidationError(_('This field is required.'))
return asset
@staticmethod

BIN
apps/locale/zh/LC_MESSAGES/django.mo

Binary file not shown.

4
apps/locale/zh/LC_MESSAGES/django.po

@ -389,8 +389,8 @@ msgstr "应用路径"
#: applications/serializers/attrs/application_category/remote_app.py:45
#: xpack/plugins/cloud/serializers.py:51
msgid "This field is required"
msgstr "这个字段是必填项"
msgid "This field is required."
msgstr "该字段是必填项。"
#: applications/serializers/attrs/application_type/chrome.py:17
#: applications/serializers/attrs/application_type/vmware_client.py:22

Loading…
Cancel
Save