Skip to content

Commit

Permalink
fix: allow delete with htmx
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rger committed Jan 24, 2024
1 parent 70450c2 commit 5e58fc4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions apis_bibsonomy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ def get_success_url(self):
)
return red

def delete(self, request, *args, **kwargs):
resp = super().delete(request, *args, **kwargs)
# we set the status code to 200 for HTMX requests, so they don't get redirected
if "HX-Request" in request.headers:
resp.status_code = 200
return resp


class ReferenceListView(ListView):
model = Reference
Expand Down

0 comments on commit 5e58fc4

Please sign in to comment.