MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / delete

Method delete

apps/plugins/api_views.py:976–989  ·  view source on GitHub ↗
(self, request, pk)

Source from the content-addressed store, hash-verified

974 responses={200: inline_serializer(name="RepoDeleteSuccess", fields={"success": serializers.BooleanField()}), 404: inline_serializer(name="RepoDeleteNotFound", fields={"error": serializers.CharField()})},
975 )
976 def delete(self, request, pk):
977 try:
978 repo = PluginRepo.objects.get(pk=pk)
979 except PluginRepo.DoesNotExist:
980 return Response(
981 {"error": "Repo not found"}, status=status.HTTP_404_NOT_FOUND
982 )
983 if repo.is_official:
984 return Response(
985 {"error": "Cannot delete the official repository"},
986 status=status.HTTP_400_BAD_REQUEST,
987 )
988 repo.delete()
989 return Response({"success": True})
990
991
992class PluginRepoRefreshAPIView(PluginAuthMixin, APIView):

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected