aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel@gmail.com>2014-02-10 07:52:50 +0100
committerCédric Bonhomme <kimble.mandel@gmail.com>2014-02-10 07:52:50 +0100
commitc336c6d45009deedae318cea9fbd82f7b530ccec (patch)
tree44f1934cb4f7fa3a52c1d5051a60a88a60e74470
parentCatch error if not articles for a feed (when detecting inactive feeds). (diff)
downloadnewspipe-c336c6d45009deedae318cea9fbd82f7b530ccec.tar.gz
newspipe-c336c6d45009deedae318cea9fbd82f7b530ccec.tar.bz2
newspipe-c336c6d45009deedae318cea9fbd82f7b530ccec.zip
Minor bug fixes.
-rw-r--r--pyaggr3g470r/forms.py4
-rw-r--r--pyaggr3g470r/models.py2
-rw-r--r--pyaggr3g470r/views.py2
3 files changed, 5 insertions, 3 deletions
diff --git a/pyaggr3g470r/forms.py b/pyaggr3g470r/forms.py
index 522877b0..f9bb5a7a 100644
--- a/pyaggr3g470r/forms.py
+++ b/pyaggr3g470r/forms.py
@@ -53,7 +53,7 @@ class SigninForm(Form):
class AddFeedForm(Form):
title = TextField("Title", [validators.Required("Please enter a title.")])
link = TextField("Feed link", [validators.Required("Please enter a link for the feed.")])
- site_link = TextField("Site link", [validators.Required("Please enter a site URL.")])
+ site_link = TextField("Site link")
email_notification = BooleanField("Email notification", default=False)
enabled = BooleanField("Check for updates", default=True)
submit = SubmitField("Save")
@@ -79,4 +79,4 @@ class ProfileForm(Form):
def validate(self):
if not Form.validate(self):
return False
- return True \ No newline at end of file
+ return True
diff --git a/pyaggr3g470r/models.py b/pyaggr3g470r/models.py
index d2f1549d..cbd49350 100644
--- a/pyaggr3g470r/models.py
+++ b/pyaggr3g470r/models.py
@@ -66,7 +66,7 @@ class Feed(EmbeddedDocument):
title = StringField(required=True)
description = StringField(default="")
link = StringField(required=True, unique=True)
- site_link = StringField(required=True)
+ site_link = StringField()
email_notification = BooleanField(default=False)
enabled = BooleanField(default=True)
articles = ListField(ReferenceField('Article', dbref = False))
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 1118c223..65e2459f 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -147,6 +147,8 @@ def feed(feed_id=None):
word_size = 6
nb_articles = models.Article.objects().count()
user = models.User.objects(email=g.user.email, feeds__oid=feed_id).first()
+ if user == None:
+ return redirect(url_for('feeds'))
for feed in user.feeds:
if str(feed.oid) == feed_id:
articles = feed.articles
bgstack15