membershipworks: Require "view EventExt" permission for upcoming events

This commit is contained in:
Adam Goldsmith 2024-01-17 11:16:43 -05:00
parent 44692d8d9b
commit 1fe097ca86

View File

@ -2,7 +2,7 @@ from datetime import datetime
from django.conf import settings from django.conf import settings
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import permission_required
from django.contrib.auth.mixins import PermissionRequiredMixin from django.contrib.auth.mixins import PermissionRequiredMixin
from django.shortcuts import render from django.shortcuts import render
from django.views.generic.dates import MonthArchiveView from django.views.generic.dates import MonthArchiveView
@ -24,8 +24,7 @@ class MemberAutocomplete(autocomplete.Select2QuerySetView):
return super().get_queryset() return super().get_queryset()
@login_required @permission_required("membershipworks.view_eventext")
# TODO: permission required?
def upcoming_events(request): def upcoming_events(request):
now = datetime.now() now = datetime.now()