feed id fix, feed_reader will now store an id and return it in the results
This commit is contained in:
parent
a3e44d640a
commit
be559501e1
|
@ -1,6 +1,9 @@
|
|||
pipeline:
|
||||
backend:
|
||||
image: maidstonehackspacewebsite_django
|
||||
environment:
|
||||
- POSTGRES_USER=mhackspace
|
||||
- USE_DOCKER=yes
|
||||
commands:
|
||||
- python manage.py test
|
||||
|
||||
|
@ -37,6 +40,4 @@ services:
|
|||
|
||||
mailhog:
|
||||
image: mailhog/mailhog
|
||||
ports:
|
||||
- "8125:8025"
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ def import_feeds(feed=False):
|
|||
articles = []
|
||||
for article in rss_articles:
|
||||
articles.append(Article(
|
||||
url=article['url'], # @olymk2 why cant I do article.url here?
|
||||
feed=Feed.objects.get(pk=1), # fixme: Nice hack :)
|
||||
url=article['url'],
|
||||
feed=Feed.objects.get(pk=article['id']),
|
||||
title=article['title'],
|
||||
original_image=article['image'],
|
||||
description=article['description'],
|
||||
|
@ -72,6 +72,7 @@ def get_active_feeds(feed=False):
|
|||
if feed.enabled is False:
|
||||
continue
|
||||
rss_feeds.append({
|
||||
'id': feed.id,
|
||||
'author': feed.author,
|
||||
'url': feed.feed_url
|
||||
})
|
||||
|
|
|
@ -16,4 +16,6 @@ class Command(BaseCommand):
|
|||
|
||||
def handle(self, *args, **options):
|
||||
imported = import_feeds(options['blog_id'])
|
||||
self.stdout.write(self.style.SUCCESS('Successfully imported %s articles' % len(imported)))
|
||||
self.stdout.write(
|
||||
self.style.SUCCESS(
|
||||
'Successfully imported %s articles' % len(imported)))
|
||||
|
|
|
@ -6,4 +6,4 @@ register = template.Library()
|
|||
|
||||
@register.inclusion_tag('feeds/list.html')
|
||||
def show_feeds():
|
||||
return {'articles': Article.objects.filter(displayed=True).select_related('feed').order_by('-date')}
|
||||
return {'articles': Article.objects.filter(displayed=True)}
|
||||
|
|
Loading…
Reference in New Issue