Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Remove extraneous params from subsequent query requests #101

Merged
merged 1 commit into from
Oct 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions pyarlo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ def _authenticate(self):
"""Authenticate user and generate token."""
self.cleanup_headers()
url = LOGIN_ENDPOINT
data = self.query(url, method='POST')
data = self.query(
url,
method='POST',
extra_params={
'email': self.__username,
'password': self.__password
})

if isinstance(data, dict) and data.get('success'):
data = data.get('data')
Expand All @@ -82,9 +88,7 @@ def cleanup_headers(self):
headers = {'Content-Type': 'application/json'}
headers['Authorization'] = self.__token
self.__headers = headers

params = {'email': self.__username, 'password': self.__password}
self.__params = params
self.__params = {}

def query(self,
url,
Expand Down