From a8a3bc984467106f006e4bd5518fa222fa82867e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 1 Mar 2024 11:11:04 +0530 Subject: [PATCH] Content server: Fix deletion of viewer profiles not working --- src/calibre/srv/content.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/srv/content.py b/src/calibre/srv/content.py index 8730f8b1ca..77346c9879 100644 --- a/src/calibre/srv/content.py +++ b/src/calibre/srv/content.py @@ -332,8 +332,8 @@ def save_reader_profile(ctx, rd): try: data = load_json_file(rd.request_body_file) name, profile = data['name'], data['profile'] - if not isinstance(profile, dict): - raise TypeError('profile must be a dict') + if not isinstance(profile, dict) and profile is not None: + raise TypeError(f'profile must be a dict not {type(profile)}') except Exception as err: raise HTTPBadRequest(f'Invalid query: {err}') from calibre.gui2.viewer.config import save_viewer_profile