From 1f5acb1a91ee284868a5a28cfa7e9ee69bace120 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Tue, 18 Sep 2018 14:02:58 -0400 Subject: [PATCH] MembershipWorks: Get org number from login data --- common.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common.py b/common.py index 3dc26c0..1ee5b7f 100644 --- a/common.py +++ b/common.py @@ -40,13 +40,13 @@ def getMembershipworksData(folders, columns): print("MembershipWorks Login Error: ", r.status_code, r.reason) print(r.text) sys.exit(1) - SFtoken = r.json()['SF'] + login_data = r.json() # get list of member/staff IDs r = requests.get(BASE_URL + "ylp", - params={"SF": SFtoken, + params={"SF": login_data['SF'], "lbl": ",".join([folder_map[f] for f in folders]), - "org": "15475", # unknown + "org": login_data['org'], "var": "_id,nam,ctc"}) if r.status_code != 200 or 'usr' not in r.json(): print("MembershipWorks User Listing Error: ", r.status_code, r.reason) @@ -57,7 +57,7 @@ def getMembershipworksData(folders, columns): # get members CSV # TODO: maybe can just use previous get instead? would return JSON r = requests.post(BASE_URL + "csv", - params={"SF": SFtoken}, + params={"SF": login_data['SF']}, data={"_rt": "946702800", # unknown "mux": "", # unknown "tid": ",".join(ids), # ids of members to get