From 44692d8d9b9d978888750f7c284d1f0a32bf3269 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Wed, 17 Jan 2024 11:15:57 -0500 Subject: [PATCH] membershipworks: Use more specific name for EventMonthReport --- membershipworks/dashboard.py | 2 +- .../{event_report.dj.html => event_month_report.dj.html} | 4 ++-- membershipworks/urls.py | 6 +++--- membershipworks/views.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename membershipworks/templates/membershipworks/{event_report.dj.html => event_month_report.dj.html} (89%) diff --git a/membershipworks/dashboard.py b/membershipworks/dashboard.py index 22d8850..d2bdb45 100644 --- a/membershipworks/dashboard.py +++ b/membershipworks/dashboard.py @@ -18,7 +18,7 @@ class MembershipworksDashboardFragment(dashboard.DashboardFragment): if self.request.user.has_perm("membershipworks.view_event"): now = datetime.now() links["Event Report"] = reverse( - "membershipworks:event-report", + "membershipworks:event-month-report", kwargs={"year": now.year, "month": now.month}, ) diff --git a/membershipworks/templates/membershipworks/event_report.dj.html b/membershipworks/templates/membershipworks/event_month_report.dj.html similarity index 89% rename from membershipworks/templates/membershipworks/event_report.dj.html rename to membershipworks/templates/membershipworks/event_month_report.dj.html index 6324a2c..6411d7e 100644 --- a/membershipworks/templates/membershipworks/event_report.dj.html +++ b/membershipworks/templates/membershipworks/event_month_report.dj.html @@ -43,7 +43,7 @@ {% if previous_month %}
  • + href="{% url 'membershipworks:event-month-report' previous_month|date:"Y" previous_month|date:"m" %}"> {{ previous_month|date:"F Y" }} @@ -55,7 +55,7 @@ {% if next_month %}
  • + href="{% url 'membershipworks:event-month-report' next_month|date:"Y" next_month|date:"m" %}"> {{ next_month|date:"F Y" }} diff --git a/membershipworks/urls.py b/membershipworks/urls.py index 71f7400..ba1e97f 100644 --- a/membershipworks/urls.py +++ b/membershipworks/urls.py @@ -1,6 +1,6 @@ from django.urls import path -from .views import MemberAutocomplete, upcoming_events, EventReport +from .views import MemberAutocomplete, upcoming_events, EventMonthReport app_name = "membershipworks" @@ -17,7 +17,7 @@ urlpatterns = [ ), path( "event-report///", - EventReport.as_view(month_format="%m"), - name="event-report", + EventMonthReport.as_view(month_format="%m"), + name="event-month-report", ), ] diff --git a/membershipworks/views.py b/membershipworks/views.py index 4a36fe0..1a20627 100644 --- a/membershipworks/views.py +++ b/membershipworks/views.py @@ -104,8 +104,8 @@ def upcoming_events(request): return render(request, "membershipworks/upcoming_events.dj.html", context) -class EventReport(PermissionRequiredMixin, MonthArchiveView): +class EventMonthReport(PermissionRequiredMixin, MonthArchiveView): permission_required = "membershipworks.view_eventext" queryset = EventExt.objects.select_related("category", "instructor").all() date_field = "start" - template_name = "membershipworks/event_report.dj.html" + template_name = "membershipworks/event_month_report.dj.html"