aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-27 02:09:26 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2014-04-27 02:09:26 +0200
commit89cf405ab970c4e289b7b79485b27aed8edb1a41 (patch)
tree7f6330fb7b9bab82a84aeb2a639377b9c4fe1d80 /pyaggr3g470r/views.py
parentThis fixes #3. (diff)
downloadnewspipe-89cf405ab970c4e289b7b79485b27aed8edb1a41.tar.gz
newspipe-89cf405ab970c4e289b7b79485b27aed8edb1a41.tar.bz2
newspipe-89cf405ab970c4e289b7b79485b27aed8edb1a41.zip
Cleaned code.
Diffstat (limited to 'pyaggr3g470r/views.py')
-rw-r--r--pyaggr3g470r/views.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py
index 514d1920..02ef4f9e 100644
--- a/pyaggr3g470r/views.py
+++ b/pyaggr3g470r/views.py
@@ -38,7 +38,6 @@ from werkzeug import generate_password_hash
import conf
import utils
import export
-import models
if not conf.ON_HEROKU:
import search as fastsearch
from forms import SigninForm, AddFeedForm, ProfileForm
@@ -103,7 +102,7 @@ def page_not_found(e):
return render_template('errors/404.html'), 404
@app.errorhandler(500)
-def page_not_found(e):
+def internal_server_error(e):
return render_template('errors/500.html'), 500
@@ -166,7 +165,7 @@ def home():
new_feed.id = feed.id
new_feed.title = feed.title
new_feed.enabled = feed.enabled
- new_feed.articles = Article.query.filter(Article.user_id == g.user.id,
+ new_feed.articles = Article.query.filter(Article.user_id == g.user.id,
Article.feed_id == feed.id).order_by(desc("Article.date")).limit(9)
result.append(new_feed)
unread_articles = len(Article.query.filter(Article.user_id == g.user.id, Article.readed == False).all())
@@ -247,7 +246,7 @@ def article(article_id=None):
return render_template('article.html', head_title=utils.clear_string(article.title), article=article)
flash("This article do not exist.", 'warning')
return redirect(redirect_url())
-
+
@app.route('/mark_as_read/', methods=['GET'])
@app.route('/mark_as_read/<int:feed_id>', methods=['GET'])
@@ -473,7 +472,7 @@ def management():
data = request.files.get('opmlfile', None)
if None == data or not allowed_file(data.filename):
flash('File not allowed.', 'danger')
- else:
+ else:
opml_path = os.path.join("./pyaggr3g470r/var/", data.filename)
data.save(opml_path)
try:
bgstack15