From 7c629770b793c7388766c7e854c2bdb995eeea93 Mon Sep 17 00:00:00 2001 From: Jonathan de Bruin Date: Mon, 12 Jun 2023 16:20:53 +0200 Subject: [PATCH] Fix missing Exception in oauth requests (#1467) --- asreview/webapp/authentication/oauth_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asreview/webapp/authentication/oauth_handler.py b/asreview/webapp/authentication/oauth_handler.py index 944377e43..d54a0066e 100644 --- a/asreview/webapp/authentication/oauth_handler.py +++ b/asreview/webapp/authentication/oauth_handler.py @@ -18,7 +18,7 @@ class OAuthHandler: def __init__(self, configs=None): if not (bool(configs) and isinstance(configs, dict)): - raise "OAuthHandler needs a configuration dictionary." + raise ValueError("OAuthHandler needs a configuration dictionary.") # check if all necessary config parameters are there services = {} @@ -39,7 +39,7 @@ def __init__(self, configs=None): ] ) ): - raise f"OAuthHandler has insufficient data for f{provider}" + raise ValueError(f"OAuthHandler has insufficient data for {provider}") else: # rebuild config services[provider.lower()] = { @@ -76,7 +76,7 @@ def get_user_credentials(self, provider, code, redirect_uri=None): elif provider == "google": result = self.__handle_google(code, redirect_uri) else: - raise f"Could not find provider {provider}" + raise ValueError(f"Could not find provider {provider}") return result def __handle_orcid(self, code):