Ejemplo n.º 1
0
 def toggle_bookmark(entity_id: int) -> str:
     if int(entity_id) in current_user.bookmarks:
         Db.delete_bookmark(current_user.id, entity_id)
         label = _('bookmark')
     else:
         Db.insert_bookmark(current_user.id, entity_id)
         label = _('bookmark remove')
     return label
Ejemplo n.º 2
0
 def toggle_bookmark(entity_id: int) -> str:
     if int(entity_id) in current_user.bookmarks:
         Db.delete_bookmark(current_user.id, entity_id)
         return 'bookmark'
     Db.insert_bookmark(current_user.id, entity_id)
     return 'bookmark remove'