I’m new to python, I’m trying to call to variables that are inside a user input in another json file, but when i try calling it nothing happens, what I’m missing?
def check_user_access(*data):
#def check_user_access(email, pra_name):
url = "https://config.zpabeta.net/mgmtconfig/v1/admin/customers/72057824892420096/approval?pagesize=500"
payload = {}
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {accesscode_zpa}",
}
response = requests.request("GET", url, headers=headers, data=payload)
j_approval = json.loads(response.text)
active_app_list = []
for approval in j_approval["list"]:
print (approval["emailIds"][0])
if approval["emailIds"][0] == data["email"]:
print (approval["emailIds"][0])
# also check for ACTIVE status
for app in approval["applications"]:
# print(" " + str(app['id']) + " (" + app_dict[app['id']]['name'] + ": " + app_dict[app['id']]['domainNames_line'] + ")")
if active_app_list[app["id"]]["domainNames_line"].__contains__(data["pra_name"]):
return True
print ("Found Same Email Address")
return False
print ("This is a NEW email")
print (data["email"])
check_user_access (data["email"],data["pra_name"])