Skip to content

Commit

Permalink
Missing search sc bearer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed May 15, 2024
1 parent 48e9bad commit 76f85d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion smartcitizen_connector/search/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,13 @@ def search_by_query(endpoint: Optional[str] = 'devices',
if 'SC_ADMIN_BEARER' in environ:
logger.info('Admin Bearer found, using it')
headers = {'Authorization':'Bearer ' + environ['SC_ADMIN_BEARER']}
elif 'SC_BEARER' in environ:
logger.info('Bearer found in environment, using it.')
# TODO make this explicit
headers = {'Authorization':'Bearer ' + environ['SC_BEARER']}
else:
logger.warning('No Bearer not found, you might get throttled!')
headers = None
logger.info('Admin Bearer not found')

url = f'{config.API_URL}{endpoint}/?'
url_queries = 0
Expand Down

0 comments on commit 76f85d9

Please sign in to comment.