FIX:Unavailable value for tipocambio crashed the loading of values

This commit is contained in:
2022-01-07 00:23:52 -03:00
parent c1eeba04a2
commit d7dfc2d221
3 changed files with 14 additions and 5 deletions

View File

@ -22,7 +22,10 @@ def validate_key(request_obj):
if isinstance(auth, list):
auth = auth[0]
if 'Bearer' in auth:
auth = auth.split(' ')[1]
try:
auth = auth.split(' ')[1]
except:
return False
return auth == api_key
if 'API_KEY' in request_obj.values:
return request_obj.values.get('API_KEY') == api_key