aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2016-02-02 22:09:18 +0100
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-02-02 22:09:18 +0100
commit5625fb1192243b19ceac9621b003df39542c4c51 (patch)
treee25f2b4d1ab0bb5e043779fd673b39ce85065e52
parentadding a confirm modal for deletion (diff)
downloadnewspipe-5625fb1192243b19ceac9621b003df39542c4c51.tar.gz
newspipe-5625fb1192243b19ceac9621b003df39542c4c51.tar.bz2
newspipe-5625fb1192243b19ceac9621b003df39542c4c51.zip
using api and repairing feed page
-rw-r--r--src/web/js/actions/RightPanelActions.js8
-rw-r--r--src/web/views/feed.py8
2 files changed, 7 insertions, 9 deletions
diff --git a/src/web/js/actions/RightPanelActions.js b/src/web/js/actions/RightPanelActions.js
index 489abae4..47adad79 100644
--- a/src/web/js/actions/RightPanelActions.js
+++ b/src/web/js/actions/RightPanelActions.js
@@ -29,12 +29,8 @@ var RightPanelActions = {
this._apiReq('DELETE', id, obj_type, null, MenuActions.reload);
},
resetErrors: function(feed_id) {
- jquery.ajax({type: 'GET',
- url: "feed/reset_errors/" + feed_id,
- success: function() {
- MenuActions.reload();
- },
- });
+ this._apiReq('PUT', feed_id, 'feed', {error_count: 0, last_error: ''},
+ MenuActions.reload);
},
};
diff --git a/src/web/views/feed.py b/src/web/views/feed.py
index 1b6c8654..959179f9 100644
--- a/src/web/views/feed.py
+++ b/src/web/views/feed.py
@@ -88,9 +88,11 @@ def delete(feed_id=None):
@login_required
def reset_errors(feed_id):
feed_contr = FeedController(g.user.id)
- feed_contr.update({'id': feed_id},
- {'error_count': 0, 'last_error': ''})
- return ''
+ feed = feed_contr.get(id=feed_id)
+ feed_contr.update({'id': feed_id}, {'error_count': 0, 'last_error': ''})
+ flash(gettext('Feed %(feed_title)r successfully updated.',
+ feed_title=feed.title), 'success')
+ return redirect(request.referrer or url_for('home'))
@feed_bp.route('/bookmarklet', methods=['GET', 'POST'])
bgstack15