aboutsummaryrefslogtreecommitdiff
path: root/newspipe/controllers/bookmark.py
diff options
context:
space:
mode:
Diffstat (limited to 'newspipe/controllers/bookmark.py')
-rw-r--r--newspipe/controllers/bookmark.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/newspipe/controllers/bookmark.py b/newspipe/controllers/bookmark.py
index 81412a5e..73f0a11f 100644
--- a/newspipe/controllers/bookmark.py
+++ b/newspipe/controllers/bookmark.py
@@ -1,5 +1,7 @@
import logging
+from flask_login import current_user
+
from .abstract import AbstractController
from .tag import BookmarkTagController
from newspipe.models import Bookmark
@@ -20,16 +22,14 @@ class BookmarkController(AbstractController):
BookmarkTagController(self.user_id).read(
**{"bookmark_id": filters["id"]}
).delete()
-
for tag in attrs["tags"]:
- BookmarkTagController(self.user_id).create(
- **{
- "text": tag.text,
- "id": tag.id,
- "bookmark_id": tag.bookmark_id,
- "user_id": tag.user_id,
- }
- )
-
+ if tag:
+ BookmarkTagController(self.user_id).create(
+ **{
+ "text": tag.strip(),
+ "user_id": current_user.id,
+ "bookmark_id": filters["id"],
+ }
+ )
del attrs["tags"]
return super().update(filters, attrs)
bgstack15