Browse Source

perf: applet 上传检查版本

pull/11311/head
ibuler 1 year ago
parent
commit
769d5fbd96
  1. 486
      apps/locale/ja/LC_MESSAGES/django.po
  2. 486
      apps/locale/zh/LC_MESSAGES/django.po
  3. 4
      apps/terminal/api/applet/applet.py

486
apps/locale/ja/LC_MESSAGES/django.po

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

4
apps/terminal/api/applet/applet.py

@ -60,6 +60,10 @@ class DownloadUploadMixin:
name = manifest['name']
update = request.query_params.get('update')
is_enterprise = manifest.get('edition') == Applet.Edition.enterprise
if is_enterprise and not settings.XPACK_ENABLED:
raise ValidationError({'error': _('This is enterprise edition applet')})
instance = Applet.objects.filter(name=name).first()
if instance and not update:
return Response({'error': 'Applet already exists: {}'.format(name)}, status=400)

Loading…
Cancel
Save