Skip to content

Commit

Permalink
Merge pull request #2964 from bookwyrm-social/delete-announcement-view
Browse files Browse the repository at this point in the history
Makes the delete announcement view post-only
  • Loading branch information
mouse-reeve authored Sep 5, 2023
2 parents bc870a3 + b0601a0 commit a09b2ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bookwyrm/views/admin/announcements.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from django.views import View
from django.views.decorators.http import require_POST

from bookwyrm import forms, models
from bookwyrm.settings import PAGE_LENGTH
Expand Down Expand Up @@ -108,6 +109,7 @@ def post(self, request, announcement_id=None):

@login_required
@permission_required("bookwyrm.edit_instance_settings", raise_exception=True)
@require_POST
def delete_announcement(_, announcement_id):
"""delete announcement"""
announcement = get_object_or_404(models.Announcement, id=announcement_id)
Expand Down

0 comments on commit a09b2ab

Please sign in to comment.