aboutsummaryrefslogtreecommitdiff
path: root/src/web/views/views.py
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-10-11 23:50:23 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-26 23:46:31 +0100
commit600391ac74a2ab29bd5c1f1433c14dae9ce6ea9b (patch)
tree58fb642ce53ef837411d6abf32d8caa5a62e9c06 /src/web/views/views.py
parentremoving misplaced stuffs from views, more controllers use (diff)
downloadnewspipe-600391ac74a2ab29bd5c1f1433c14dae9ce6ea9b.tar.gz
newspipe-600391ac74a2ab29bd5c1f1433c14dae9ce6ea9b.tar.bz2
newspipe-600391ac74a2ab29bd5c1f1433c14dae9ce6ea9b.zip
moving 'expire_article' and improving its perf
Diffstat (limited to 'src/web/views/views.py')
-rw-r--r--src/web/views/views.py17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/web/views/views.py b/src/web/views/views.py
index f543c6fa..4abea96e 100644
--- a/src/web/views/views.py
+++ b/src/web/views/views.py
@@ -416,20 +416,3 @@ def export_opml():
response.headers['Content-Type'] = 'application/xml'
response.headers['Content-Disposition'] = 'attachment; filename=feeds.opml'
return response
-
-
-@app.route('/expire_articles', methods=['GET'])
-@login_required
-def expire_articles():
- """
- Delete articles older than the given number of weeks.
- """
- weeks_ago = datetime.datetime.utcnow() - \
- datetime.timedelta(weeks=int(request.args.get('weeks', 10)))
- Article.query.filter(
- and_(Article.user_id == g.user.id,
- or_(Article.date < weeks_ago,
- Article.retrieved_date < weeks_ago))).delete()
- flash(gettext('Articles deleted.'), 'info')
- db.session.commit()
- return redirect(redirect_url())
bgstack15