Default to the first authenticated user if the list's user is not found

pull/54/head
Mitchell Klijs 7 years ago
parent 11a3da97d7
commit 060b10814b

@ -161,7 +161,9 @@ class Trakt:
def oauth_headers(self, user): def oauth_headers(self, user):
headers = self.headers headers = self.headers
if user is None: if user is None or user not in self.cfg['trakt'].keys():
log.debug('No authenticated user corresponds to "%s", so the first user in the config to authenticated.', user)
users = self.cfg['trakt'] users = self.cfg['trakt']
if 'api_key' in users.keys(): if 'api_key' in users.keys():

Loading…
Cancel
Save