Skip to content

Commit 9624329

Browse files
authored
Update user_login method to submit form data as dictionary instead of str.format() (#72)
1 parent acb5de9 commit 9624329

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

piazza_api/rpc.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,14 @@ def user_login(self, email=None, password=None):
7777

7878
# Log in using credentials and CSRF token and store cookie in session
7979
response = self.session.post(
80-
'https://piazza.com/class',
81-
data=r'from=%2Fsignup&email={0}&password={1}&remember=on&csrf_token={2}'.format(email, password, csrf_token)
80+
"https://piazza.com/class",
81+
data={
82+
"from": "/signup",
83+
"email": email,
84+
"password": password,
85+
"remember": "on",
86+
"csrf_token": csrf_token,
87+
},
8288
)
8389

8490
# If non-successful http response, bail

0 commit comments

Comments
 (0)