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

pull/20/head
Mitchell Klijs 7 years ago
parent 3d7c1e8703
commit 8ab620d9dd

@ -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