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,9 +161,11 @@ class Trakt:
def oauth_headers(self, user):
headers = self.headers
if user is None:
users = self.cfg['trakt']
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']
if 'api_key' in users.keys():
users.pop('api_key')

Loading…
Cancel
Save