mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 01:21:07 +00:00
Merge pull request #2964 from bookwyrm-social/delete-announcement-view
Makes the delete announcement view post-only
This commit is contained in:
commit
a09b2ab45c
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