From e5ab9eeae91b898cca30aa81c8219e22df325979 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Fri, 12 Sep 2014 16:46:14 +0200 Subject: [PATCH] [Favorites] fix creating podcast from favorites feed --- mygpo/share/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mygpo/share/views.py b/mygpo/share/views.py index 3b0c10a6..4dbb7a2d 100644 --- a/mygpo/share/views.py +++ b/mygpo/share/views.py @@ -30,7 +30,7 @@ class FavoritesPublic(View): request.user.profile.save() else: - request.user.profile.create_new_token('favorite_feeds_token', 8) + request.user.profile.create_new_token('favorite_feeds_token') request.user.profile.save() token = request.user.favorite_feeds_token @@ -96,9 +96,10 @@ class FavoritesFeedCreateEntry(View): podcast = Podcast.objects.get_or_create_for_url(feed_url) - if not podcast.get_id() in user.published_objects: - user.published_objects.append(podcast.get_id()) - user.save() + PublishedPodcast.objects.get_or_create( + podcast=podcast, + publisher=user, + ) updater = PodcastUpdater() updater.update(feed_url) -- 2.11.4.GIT