cmsmanage/membershipworks/dashboard.py
Adam Goldsmith 560225cdb3
All checks were successful
Ruff / ruff (push) Successful in 20s
membershipworks: Add new event attendee email report
2024-02-02 19:26:06 -05:00

26 lines
688 B
Python

from typing import Any
from django.urls import reverse
import dashboard
@dashboard.register
class MembershipworksDashboardFragment(dashboard.DashboardFragment):
name = "MembershipWorks"
template = "dashboard/links_card.dj.html"
@property
def context(self) -> Any:
links = {}
if self.request.user.has_perm("membershipworks.view_event"):
links["Event Report"] = reverse("membershipworks:event-index-report")
links["Event Attendees"] = reverse("membershipworks:event-attendees")
return {"links": links}
@property
def visible(self) -> bool:
return self.request.user.has_perm("doorcontrol.view_hidevent")