From 8cf2ba0edfa54ba4870367120a0829e06ee28e2b Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Tue, 2 Mar 2021 19:37:48 -0800 Subject: [PATCH] fix edit_feed redirect, add edit_feed link to feed view --- audio/templates/audio/index.html | 7 +++++++ audio/views.py | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/audio/templates/audio/index.html b/audio/templates/audio/index.html index d4e8c6c..b6b6198 100644 --- a/audio/templates/audio/index.html +++ b/audio/templates/audio/index.html @@ -17,6 +17,13 @@
+ {% if user.is_authenticated %} + {% if view == 'feed' %} + + {% endif %} + {% endif %} {% for j in episodes %}

diff --git a/audio/views.py b/audio/views.py index ce7753d..ecd61ba 100644 --- a/audio/views.py +++ b/audio/views.py @@ -19,8 +19,9 @@ def feed(request, pk, slug): return render( request, 'audio/index.html', { - 'episodes': episodes, 'IMAGES_URL': IMAGES_URL, - 'MP3_URL': MP3_URL, 'title': feed.title, 'heading': feed.title + 'episodes': episodes, 'IMAGES_URL': IMAGES_URL, 'view': 'feed', + 'MP3_URL': MP3_URL, 'title': feed.title, 'heading': feed.title, + 'feed_pk': pk, 'feed_slug': slug, }) @@ -70,7 +71,7 @@ def edit_feed(request, pk, title_slug): form = FeedForm(request.POST, request.FILES, instance=feed) if form.is_valid(): feed.save() - return redirect('audio:new_feed') + return redirect('audio:feed', pk=pk, slug=title_slug) else: form = FeedForm(instance=feed) return render(