mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 02:51:13 +00:00
Makes deleting announcements only work via POST
This commit is contained in:
parent
e5f8e4babc
commit
b0601a0958
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,7 @@ from django.shortcuts import get_object_or_404, redirect
|
|||
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
|
||||
|
@ -108,6 +109,7 @@ class EditAnnouncement(View):
|
|||
|
||||
@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)
|
||||
|
|
Loading…
Reference in a new issue