2019-10-28 13:26:34 +00:00
|
|
|
"""passbook Event administration"""
|
2020-07-15 17:34:53 +01:00
|
|
|
from django.contrib.auth.mixins import LoginRequiredMixin
|
2018-12-14 09:28:37 +00:00
|
|
|
from django.views.generic import ListView
|
2019-10-10 12:01:49 +01:00
|
|
|
from guardian.mixins import PermissionListMixin
|
2018-12-14 09:28:37 +00:00
|
|
|
|
2020-10-17 21:26:18 +01:00
|
|
|
from passbook.admin.views.utils import SearchListMixin, UserPaginateListMixin
|
2019-10-28 13:26:34 +00:00
|
|
|
from passbook.audit.models import Event
|
2018-12-14 09:28:37 +00:00
|
|
|
|
|
|
|
|
2020-09-26 00:51:42 +01:00
|
|
|
class EventListView(
|
2020-10-17 21:26:18 +01:00
|
|
|
PermissionListMixin,
|
|
|
|
LoginRequiredMixin,
|
|
|
|
SearchListMixin,
|
|
|
|
UserPaginateListMixin,
|
|
|
|
ListView,
|
2020-09-26 00:51:42 +01:00
|
|
|
):
|
2018-12-14 09:28:37 +00:00
|
|
|
"""Show list of all invitations"""
|
|
|
|
|
2019-10-28 13:26:34 +00:00
|
|
|
model = Event
|
2020-06-30 09:23:54 +01:00
|
|
|
template_name = "audit/list.html"
|
2019-12-31 11:51:16 +00:00
|
|
|
permission_required = "passbook_audit.view_event"
|
|
|
|
ordering = "-created"
|
2020-10-17 21:26:18 +01:00
|
|
|
|
|
|
|
search_fields = [
|
|
|
|
"user",
|
|
|
|
"action",
|
|
|
|
"app",
|
|
|
|
"context",
|
|
|
|
"client_ip",
|
|
|
|
]
|