1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2024-10-31 23:45:49 +00:00

use generic View instead of TemplateView when not rendering templates

This commit is contained in:
Franzi 2022-11-22 19:19:33 +01:00
parent d42a2744d0
commit 8dd9bec525
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -2,6 +2,7 @@ import datetime as dt
import pytz
from django.http import JsonResponse
from django.views import View
from django.views.generic import FormView
from django.views.generic.base import TemplateView
from pretalx.agenda.views.schedule import ScheduleMixin
@ -49,7 +50,7 @@ class BroadcastToolsOrgaView(PermissionRequired, FormView):
}
class BroadcastToolsEventInfoView(TemplateView):
class BroadcastToolsEventInfoView(View):
def get(self, request, *args, **kwargs):
color = self.request.event.primary_color or "#3aa57c"
return JsonResponse(
@ -64,7 +65,7 @@ class BroadcastToolsEventInfoView(TemplateView):
)
class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, TemplateView):
class BroadcastToolsScheduleView(EventPermissionRequired, ScheduleMixin, View):
permission_required = "agenda.view_schedule"
def get(self, request, *args, **kwargs):