diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-02-26 15:20:54 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2020-02-26 15:20:54 +0100 |
commit | c0d48f8a060fa30107183ad024e8c03cfee0eb26 (patch) | |
tree | e1aab8c092be0c2bd1e51d6ac09187096490652f /newspipe/web/controllers/bookmark.py | |
parent | Removed sendgrid dependency. (diff) | |
download | newspipe-c0d48f8a060fa30107183ad024e8c03cfee0eb26.tar.gz newspipe-c0d48f8a060fa30107183ad024e8c03cfee0eb26.tar.bz2 newspipe-c0d48f8a060fa30107183ad024e8c03cfee0eb26.zip |
added a little black magic
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) |