Skip to content

Commit

Permalink
Hid Podcasts behind loginwall
Browse files Browse the repository at this point in the history
  • Loading branch information
xenakistheo committed Feb 8, 2024
1 parent 0f53dcf commit 92a52dd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nablapps/podcast/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
from django.http import Http404
from django.views.generic import DetailView, ListView, TemplateView

from braces.views import LoginRequiredMixin
from hitcount.views import HitCountDetailView

from nablapps.core.view_mixins import AdminLinksMixin, FlatPageMixin

from .models import Podcast, Season, get_season_count


class SeasonView(FlatPageMixin, TemplateView):
class SeasonView(LoginRequiredMixin, FlatPageMixin, TemplateView):
template_name = "podcast/season.html"
flatpages = [("info", "/skraattcast/")]

Expand Down Expand Up @@ -47,7 +48,7 @@ def get_context_data(self, **kwargs):
return data


class RssView(ListView):
class RssView(LoginRequiredMixin, ListView):
template_name = "podcast/podcast.rss"
content_type = "application/xml"
model = Podcast
Expand All @@ -56,7 +57,9 @@ class RssView(ListView):
)


class PodcastDetailView(AdminLinksMixin, HitCountDetailView, DetailView):
class PodcastDetailView(
LoginRequiredMixin, AdminLinksMixin, HitCountDetailView, DetailView
):
template_name = "podcast/podcast_detail.html"
model = Podcast
context_object_name = "podcast"
Expand Down

0 comments on commit 92a52dd

Please sign in to comment.