diff options
Diffstat (limited to 'newspipe/web/controllers/bookmark.py')
-rw-r--r-- | newspipe/web/controllers/bookmark.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/newspipe/web/controllers/bookmark.py b/newspipe/web/controllers/bookmark.py index b5413243..d1c1260c 100644 --- a/newspipe/web/controllers/bookmark.py +++ b/newspipe/web/controllers/bookmark.py @@ -17,16 +17,19 @@ class BookmarkController(AbstractController): return self._count_by(Bookmark.href, filters) def update(self, filters, attrs): - BookmarkTagController(self.user_id) \ - .read(**{'bookmark_id': filters["id"]}) \ - .delete() + BookmarkTagController(self.user_id).read( + **{"bookmark_id": filters["id"]} + ).delete() - for tag in attrs['tags']: + 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}) - - del attrs['tags'] + **{ + "text": tag.text, + "id": tag.id, + "bookmark_id": tag.bookmark_id, + "user_id": tag.user_id, + } + ) + + del attrs["tags"] return super().update(filters, attrs) |