forked from rc/aircox
Feat: packaging (#127)
- Add configuration files for packaging - Precommit now uses ruff Co-authored-by: bkfox <thomas bkfox net> Reviewed-on: rc/aircox#127
This commit is contained in:
@@ -24,9 +24,7 @@ class BaseView(TemplateResponseMixin, ContextMixin):
|
||||
|
||||
def get_sidebar_queryset(self):
|
||||
"""Return a queryset of items to render on the side nav."""
|
||||
return (
|
||||
Page.objects.select_subclasses().published().order_by("-pub_date")
|
||||
)
|
||||
return Page.objects.select_subclasses().published().order_by("-pub_date")
|
||||
|
||||
def get_sidebar_url(self):
|
||||
return reverse("page-list")
|
||||
@@ -43,20 +41,14 @@ class BaseView(TemplateResponseMixin, ContextMixin):
|
||||
if has_sidebar and "sidebar_object_list" not in kwargs:
|
||||
sidebar_object_list = self.get_sidebar_queryset()
|
||||
if sidebar_object_list is not None:
|
||||
kwargs["sidebar_object_list"] = sidebar_object_list[
|
||||
: self.list_count
|
||||
]
|
||||
kwargs["sidebar_object_list"] = sidebar_object_list[: self.list_count]
|
||||
kwargs["sidebar_list_url"] = self.get_sidebar_url()
|
||||
|
||||
if "audio_streams" not in kwargs:
|
||||
kwargs["audio_streams"] = self.station.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)
|
||||
|
||||
Reference in New Issue
Block a user