aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-09 21:18:16 +0200
committerGravatar Tom Willemse2013-05-09 21:18:16 +0200
commitc413a73eebdb41b1085bc690d30a475b9da1316e (patch)
tree10785e0fec61773fe687b75b9c5f1492722f9e5e
parent760adb211a4256a671b9afea98d9a633e550b384 (diff)
downloadryuslash.org-c413a73eebdb41b1085bc690d30a475b9da1316e.tar.gz
ryuslash.org-c413a73eebdb41b1085bc690d30a475b9da1316e.zip
Leave title blank for posts without title
-rw-r--r--ryuslash/aggregator/management/commands/loadfeeds.py16
-rw-r--r--ryuslash/aggregator/models.py2
2 files changed, 10 insertions, 8 deletions
diff --git a/ryuslash/aggregator/management/commands/loadfeeds.py b/ryuslash/aggregator/management/commands/loadfeeds.py
index f826312..5663653 100644
--- a/ryuslash/aggregator/management/commands/loadfeeds.py
+++ b/ryuslash/aggregator/management/commands/loadfeeds.py
@@ -87,13 +87,15 @@ class Command(BaseCommand):
if feedoptions.get('nl2br'):
content = re.sub('\n', '</br>\n', content)
- post = Post(post_id=entry.id,
- title=entry.title,
- category=feedoptions['category'],
- link=entry.link,
- updated=updated,
- icon=icon,
- content=content)
+ post = Post(
+ post_id=entry.id,
+ title=entry.title if feedoptions.get('title') else '',
+ category=feedoptions['category'],
+ link=entry.link,
+ updated=updated,
+ icon=icon,
+ content=content
+ )
post.save()
newcount += 1
diff --git a/ryuslash/aggregator/models.py b/ryuslash/aggregator/models.py
index 34fb5a3..ac3d278 100644
--- a/ryuslash/aggregator/models.py
+++ b/ryuslash/aggregator/models.py
@@ -3,7 +3,7 @@ from django.db import models
class Post(models.Model):
post_id = models.CharField(max_length=255, unique=True,
primary_key=True)
- title = models.CharField(max_length=500)
+ title = models.CharField(max_length=500, blank=True)
category = models.CharField(max_length=255)
link = models.URLField(max_length=255)
updated = models.DateTimeField()