From d1de741695d1df5e68c425690e9c0fd195741b29 Mon Sep 17 00:00:00 2001 From: PieterL75 <74899468+PieterL75@users.noreply.github.com> Date: Fri, 18 Mar 2022 15:52:26 +0100 Subject: [PATCH] Optimize return values Co-authored-by: Jeremy Stretch --- netbox/netbox/api/authentication.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/netbox/netbox/api/authentication.py b/netbox/netbox/api/authentication.py index f5454135e..646331749 100644 --- a/netbox/netbox/api/authentication.py +++ b/netbox/netbox/api/authentication.py @@ -29,9 +29,7 @@ class TokenAuthentication(authentication.TokenAuthentication): if not token.validate_client_ip(clientip): raise exceptions.AuthenticationFailed(f"Source IP {clientip} is not allowed to use this token.") - return token_user, token - else: - return None + return authenticationresult def authenticate_credentials(self, key): model = self.get_model()