membershipworks: Use more specific name for EventMonthReport

This commit is contained in:
Adam Goldsmith 2024-01-17 11:15:57 -05:00
parent 270e6c7837
commit 44692d8d9b
4 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@ class MembershipworksDashboardFragment(dashboard.DashboardFragment):
if self.request.user.has_perm("membershipworks.view_event"): if self.request.user.has_perm("membershipworks.view_event"):
now = datetime.now() now = datetime.now()
links["Event Report"] = reverse( links["Event Report"] = reverse(
"membershipworks:event-report", "membershipworks:event-month-report",
kwargs={"year": now.year, "month": now.month}, kwargs={"year": now.year, "month": now.month},
) )

View File

@ -43,7 +43,7 @@
{% if previous_month %} {% if previous_month %}
<li class="page-item"> <li class="page-item">
<a class="page-link" <a class="page-link"
href="{% url 'membershipworks:event-report' previous_month|date:"Y" previous_month|date:"m" %}"> href="{% url 'membershipworks:event-month-report' previous_month|date:"Y" previous_month|date:"m" %}">
<i class="bi bi-arrow-left"></i> <i class="bi bi-arrow-left"></i>
{{ previous_month|date:"F Y" }} {{ previous_month|date:"F Y" }}
</a> </a>
@ -55,7 +55,7 @@
{% if next_month %} {% if next_month %}
<li class="page-item"> <li class="page-item">
<a class="page-link" <a class="page-link"
href="{% url 'membershipworks:event-report' next_month|date:"Y" next_month|date:"m" %}"> href="{% url 'membershipworks:event-month-report' next_month|date:"Y" next_month|date:"m" %}">
{{ next_month|date:"F Y" }} {{ next_month|date:"F Y" }}
<i class="bi bi-arrow-right"></i> <i class="bi bi-arrow-right"></i>
</a> </a>

View File

@ -1,6 +1,6 @@
from django.urls import path from django.urls import path
from .views import MemberAutocomplete, upcoming_events, EventReport from .views import MemberAutocomplete, upcoming_events, EventMonthReport
app_name = "membershipworks" app_name = "membershipworks"
@ -17,7 +17,7 @@ urlpatterns = [
), ),
path( path(
"event-report/<int:year>/<int:month>/", "event-report/<int:year>/<int:month>/",
EventReport.as_view(month_format="%m"), EventMonthReport.as_view(month_format="%m"),
name="event-report", name="event-month-report",
), ),
] ]

View File

@ -104,8 +104,8 @@ def upcoming_events(request):
return render(request, "membershipworks/upcoming_events.dj.html", context) return render(request, "membershipworks/upcoming_events.dj.html", context)
class EventReport(PermissionRequiredMixin, MonthArchiveView): class EventMonthReport(PermissionRequiredMixin, MonthArchiveView):
permission_required = "membershipworks.view_eventext" permission_required = "membershipworks.view_eventext"
queryset = EventExt.objects.select_related("category", "instructor").all() queryset = EventExt.objects.select_related("category", "instructor").all()
date_field = "start" date_field = "start"
template_name = "membershipworks/event_report.dj.html" template_name = "membershipworks/event_month_report.dj.html"