- player bug in admin fix

- player rendering issue fix
- station.streams property
- glitch in template rendering when page parent is not published
This commit is contained in:
bkfox
2022-12-16 14:53:11 +01:00
parent 8bd11f363b
commit 246eba6654
9 changed files with 40 additions and 19 deletions

View File

@ -1,14 +1,10 @@
from django.http import Http404
from django.views.generic import DetailView, ListView
from django.views.generic.base import TemplateResponseMixin, ContextMixin
from django.urls import reverse
from ..models import Page
from ..utils import Redirect
__all__ = ['BaseView']
__all__ = ('BaseView', 'BaseAPIView')
class BaseView(TemplateResponseMixin, ContextMixin):
@ -55,8 +51,8 @@ class BaseView(TemplateResponseMixin, ContextMixin):
kwargs['audio_streams'] = streams
if 'model' not in kwargs:
model = getattr(self, 'model', None) or hasattr(self, 'object') and \
type(self.object)
model = getattr(self, 'model', None) or \
hasattr(self, 'object') and type(self.object)
kwargs['model'] = model
return super().get_context_data(**kwargs)