mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-13 13:59:17 +00:00
perf: 优化支持 choices (#10151)
* perf: 支持自定义类型资产 * perf: 改名前 * perf: 优化支持 choices * perf: 优化自定义资产 * perf: 优化资产的详情 * perf: 修改完成自定义平台和资产 --------- Co-authored-by: ibuler <ibuler@qq.com> Co-authored-by: Jiangjie.Bai <bugatti_it@163.com>
This commit is contained in:
@@ -64,13 +64,7 @@ class DownloadUploadMixin:
|
||||
if instance and not update:
|
||||
return Response({'error': 'Applet already exists: {}'.format(name)}, status=400)
|
||||
|
||||
serializer = serializers.AppletSerializer(data=manifest, instance=instance)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
save_to = default_storage.path('applets/{}'.format(name))
|
||||
if os.path.exists(save_to):
|
||||
shutil.rmtree(save_to)
|
||||
shutil.move(tmp_dir, save_to)
|
||||
serializer.save()
|
||||
applet, serializer = Applet.install_from_dir(tmp_dir)
|
||||
return Response(serializer.data, status=201)
|
||||
|
||||
@action(detail=True, methods=['get'])
|
||||
|
Reference in New Issue
Block a user