Merge pull request #2395 from bookwyrm-social/settings-view-perms

Fixes permissions on settings invite request page
This commit is contained in:
Mouse Reeve 2022-11-16 18:33:20 -08:00 committed by GitHub
commit 2dad14bdcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -11,7 +11,7 @@ from django.utils.translation import gettext_lazy as _
env = Env()
env.read_env()
DOMAIN = env("DOMAIN")
VERSION = "0.4.6"
VERSION = "0.5.0"
RELEASE_API = env(
"RELEASE_API",

View file

@ -85,6 +85,11 @@ class Invite(View):
# post handling is in views.register.Register
@method_decorator(login_required, name="dispatch")
@method_decorator(
permission_required("bookwyrm.create_invites", raise_exception=True),
name="dispatch",
)
class ManageInviteRequests(View):
"""grant invites like the benevolent lord you are"""
@ -177,6 +182,7 @@ class InviteRequest(View):
@require_POST
@permission_required("bookwyrm.create_invites", raise_exception=True)
def ignore_invite_request(request):
"""hide an invite request"""
invite_request = get_object_or_404(