aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2017-02-13 15:27:13 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2017-02-13 15:27:13 +0100
commit879427aa740f399aecd31c0e12909e6f39705f5e (patch)
tree5bb2d792e7211c763db550eaf8f0c676e37aa25a /src/web/views
parentMerge branch 'master' of github.com:newspipe/newspipe into bookmark (diff)
downloadnewspipe-879427aa740f399aecd31c0e12909e6f39705f5e.tar.gz
newspipe-879427aa740f399aecd31c0e12909e6f39705f5e.tar.bz2
newspipe-879427aa740f399aecd31c0e12909e6f39705f5e.zip
wip
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/bookmark.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/web/views/bookmark.py b/src/web/views/bookmark.py
index d780a3ae..c2fdc597 100644
--- a/src/web/views/bookmark.py
+++ b/src/web/views/bookmark.py
@@ -10,6 +10,7 @@ import conf
from bootstrap import db
from web.forms import BookmarkForm
from web.controllers import BookmarkController
+from web.models.tag import BookmarkTag
logger = logging.getLogger(__name__)
bookmarks_bp = Blueprint('bookmarks', __name__, url_prefix='/bookmarks')
@@ -38,7 +39,7 @@ def form(bookmark_id=None):
action = gettext('Edit bookmark')
head_titles = [action]
form = BookmarkForm(obj=bookmark)
- form.tags.data = ", ".join(bookmark.tags)
+ form.tags.data = bookmark.tags
return render_template('edit_bookmark.html', action=action,
head_titles=head_titles, bookmark=bookmark,
form=form)
@@ -57,18 +58,17 @@ def process_form(bookmark_id=None):
# Edit an existing bookmark
bookmark_attr = {'href': form.href.data,
'description': form.description.data,
- 'extended': form.extended.data,
+ 'title': form.title.data,
'tags': [tag.strip() for tag in form.tags.data.split(',')],
'shared': form.shared.data,
'to_read': form.to_read.data}
if bookmark_id is not None:
- bookmark = BookmarkController(current_user.id).get(id=bookmark_id)
- form.populate_obj(bookmark)
- bookmark.tags = [tag.strip() for tag in form.tags.data.split(',')]
- db.session.commit()
-
- #bookmark_contr.update({'id': bookmark_id}, bookmark_attr)
+ # bookmark = BookmarkController(current_user.id).get(id=bookmark_id)
+ # form.populate_obj(bookmark)
+ # bookmark.tags = [tag.strip() for tag in form.tags.data.split(',')],
+ # db.session.commit()
+ bookmark_contr.update({'id': bookmark_id}, bookmark_attr)
flash(gettext('Bookmark successfully updated.'), 'success')
return redirect(url_for('bookmark.form', bookmark_id=bookmark_id))
bgstack15