diff --git a/cps/kobo_sync_status.py b/cps/kobo_sync_status.py index 8c1ca7c5..ee9f0779 100644 --- a/cps/kobo_sync_status.py +++ b/cps/kobo_sync_status.py @@ -54,7 +54,7 @@ def remove_synced_book(book_id, all=False, session=None): def change_archived_books(book_id, state=None, message=None): archived_book = ub.session.query(ub.ArchivedBook).filter(and_(ub.ArchivedBook.user_id == int(current_user.id), ub.ArchivedBook.book_id == book_id)).first() - if not archived_book and state == True: + if not archived_book and (state == True or state == None): archived_book = ub.ArchivedBook(user_id=current_user.id, book_id=book_id) archived_book.is_archived = state if state != None else not archived_book.is_archived