Optimize return values

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
This commit is contained in:
PieterL75 2022-03-18 15:52:26 +01:00 committed by GitHub
parent 77c3d67c47
commit d1de741695
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,9 +29,7 @@ class TokenAuthentication(authentication.TokenAuthentication):
if not token.validate_client_ip(clientip): if not token.validate_client_ip(clientip):
raise exceptions.AuthenticationFailed(f"Source IP {clientip} is not allowed to use this token.") raise exceptions.AuthenticationFailed(f"Source IP {clientip} is not allowed to use this token.")
return token_user, token return authenticationresult
else:
return None
def authenticate_credentials(self, key): def authenticate_credentials(self, key):
model = self.get_model() model = self.get_model()