super_user and services updated
This commit is contained in:
@@ -94,12 +94,13 @@ class RequestToApi:
|
||||
access_token = content.get("access_token")
|
||||
refresh_token = content.get("refresh_token")
|
||||
access_object = content.get("access_object")
|
||||
print('access_object', access_object)
|
||||
if not access_object:
|
||||
raise Exception("Access object is not found")
|
||||
|
||||
companies_uu_id_list = None
|
||||
if access_object.get("user_type") == "employee":
|
||||
companies_uu_id_list = access_object.get("companies_uu_id_list")
|
||||
companies_uu_id_list = access_object.get("companies_list")
|
||||
elif access_object.get("user_type") == "occupant":
|
||||
companies_uu_id_list = access_object.get("available_occupants")
|
||||
|
||||
@@ -111,7 +112,8 @@ class RequestToApi:
|
||||
|
||||
self.set_access_token(access_token)
|
||||
if access_object.get("user_type") == "employee":
|
||||
uu_id = companies_uu_id_list[0]
|
||||
uu_id = companies_uu_id_list[0].get('uu_id')
|
||||
print('uu_id', uu_id)
|
||||
refresh_company = self.post(
|
||||
endpoint="authentication/select", data={"company_uu_id": uu_id}
|
||||
)
|
||||
|
||||
@@ -50,8 +50,8 @@ def decode_as_json_indent(data):
|
||||
return json.dumps(json.loads(json.dumps(data)), indent=2)
|
||||
|
||||
|
||||
password_token = "FGS095it2IBP3gIp5glaG6u9tQy1KEPzKnBYE1fvGJSGvGUhwaGgxE-56yZAxUQnW-a_J91twOFKTWTc0ue4GZq10vY7fK2cZBsR9bUDJMCHZZZGpFYbsE6pLyaDs-1_K8v5hbggSmpXNFfafMmujuXxqvSzdLQa5hcg9qepHBOvgTbL28wGRHx9w-Fcb7bL"
|
||||
password_token_occ = "kM9vHcWZVVF38IyNxMk6XMlCc8FCc_P1D-0D2u-Er5FrcQzvswSjJe9Lu9QnhJ5fJw5WqC45UYxopme_aCX6YDfZfQ3wQ9RP4Ak5YYTWBZbtwKGXTomlpYCQJghy0RC-1-Q9ATNEgcjYXqU2P9UjjdS9JNvhUawT0R38wXap-Mum6oazjqiKow41SUebnZ-H"
|
||||
password_token = "AVqRAPWQ9yvZqX14pWEAHfv72MsTYbjrlPNH97xDPr9RrDySPmu1zlPEH-IsQ9GNR1wrGQHv4xsR6eNbZYDe8rnvYbaiGOFpu1t18AMOZBEB3cKiashFCXznglPGd670QmAsRAqC-VO8GsIoGjtRr2ZQCKVY2lXTc3RcqRA26YXP31Bc-mDr_nzpjQCGrVcd"
|
||||
password_token_occ = ""
|
||||
login_data = {
|
||||
"domain": "evyos.com.tr",
|
||||
"access_key": "karatay.berkay.sup@evyos.com.tr",
|
||||
@@ -67,8 +67,8 @@ login_creds_occupant = {
|
||||
"password_token": password_token_occ,
|
||||
}
|
||||
selection_list = [
|
||||
"d9ffa716-331c-48fc-83b2-47bf31289b3e",
|
||||
"afebb7f8-9f62-4703-b11c-ee8f14fe73b7",
|
||||
# "d9ffa716-331c-48fc-83b2-47bf31289b3e",
|
||||
# "afebb7f8-9f62-4703-b11c-ee8f14fe73b7",
|
||||
]
|
||||
|
||||
manager_token = "g0Z1YYjh2WqFfoI3MdJ9wrfXAHeL6f7UatEkySzOK0dFX6CH1sXgjQ"
|
||||
@@ -93,11 +93,11 @@ if assign_people_to_create_item == -1:
|
||||
local_api.selected_object = local_api.login_via_email_and_password(
|
||||
login_data=login_data, is_password_valid=False
|
||||
)
|
||||
# migrate_company(requester=both_apis)
|
||||
# migrate_people(requester=both_apis)
|
||||
# migrate_build(requester=both_apis)
|
||||
# migrate_build_living_space(requester=both_apis)
|
||||
migrate_account_records(requester=both_apis)
|
||||
migrate_company(requester=both_apis)
|
||||
migrate_people(requester=both_apis)
|
||||
migrate_build(requester=both_apis)
|
||||
migrate_build_living_space(requester=both_apis)
|
||||
# migrate_account_records(requester=both_apis)
|
||||
if assign_people_to_create_item == 0:
|
||||
|
||||
if not bool(selection_list):
|
||||
|
||||
Reference in New Issue
Block a user