sources/plex: fix check_token error unusable if token is empty (#4834)

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-03-02 23:21:54 +01:00 committed by GitHub
parent e47bbe63b8
commit 9370d155f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,7 +29,9 @@ def check_plex_token(self: MonitoredTask, source_slug: int):
auth.get_user_info()
self.set_status(TaskResult(TaskResultStatus.SUCCESSFUL, ["Plex token is valid."]))
except RequestException as exc:
error = exception_to_string(exc).replace(source.plex_token, "$PLEX_TOKEN")
error = exception_to_string(exc)
if source.plex_token != "":
error = error.replace(source.plex_token, "$PLEX_TOKEN")
self.set_status(
TaskResult(
TaskResultStatus.ERROR,