Merge pull request #11311 from jumpserver/pr@dev@perf_applet_enterprise

perf: applet 上传检查版本
pull/11318/head
老广 1 year ago committed by GitHub
commit cbb615e2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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