Skip to content

Commit

Permalink
Clean up after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rup-Narayan-Rajbanshi committed Dec 10, 2024
1 parent 18420ec commit a647275
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions local_units/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@ def get_serializer_class(self):
def destroy(self, request, *args, **kwargs):
return bad_request("Delete method not allowed")

@extend_schema(responses=PrivateLocalUnitSerializer)
@action(detail=True, methods=["put"], url_path="deprecate")
def deprecate(self, request, pk=None):
"""Deprecate an object by ID."""
instance = self.get_object()
serializer = LocalUnitDepricateSerializer(data=request.data)
if serializer.is_valid():
serializer.save(instance)
return response.Response(
{"message": f"Object {instance.id}-{instance.is_deprecated} deprecated successfully."},
status=status.HTTP_200_OK,
)
return response.Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)

@extend_schema(responses=PrivateLocalUnitSerializer)
@action(
detail=True,
Expand Down

0 comments on commit a647275

Please sign in to comment.