Commit 4dc583fd authored by David Huebner's avatar David Huebner

mod tasks http method to post

parent 0383ff79
......@@ -9,19 +9,19 @@ class granted:
if not getattr(settings, 'CRUST_TASK_URL_1') == '':
json_body = provide_request_body(user_ldap_entry)
#headers = {'X-TENANT-ID': 'lui2backend', 'Authorization': 'Basic ' + base64.b64encode('crust:Unity-Grease-Cow-Sensitive-Despair-5'.encode()).decode()}
response = requests.get(getattr(settings, 'CRUST_TASK_URL_1'), data=json_body, timeout=1)
response = requests.post(getattr(settings, 'CRUST_TASK_URL_1'), data=json_body, timeout=1)
if response.status_code is not 200:
return response.status_code
if not getattr(settings, 'CRUST_TASK_URL_2') == '':
json_body = provide_request_body(user_ldap_entry)
#headers = {'X-TENANT-ID': 'lui2backend', 'Authorization': 'Basic ' + base64.b64encode('crust:Unity-Grease-Cow-Sensitive-Despair-5'.encode()).decode()}
response = requests.get(getattr(settings, 'CRUST_TASK_URL_2'), data=json_body, timeout=1)
response = requests.post(getattr(settings, 'CRUST_TASK_URL_2'), data=json_body, timeout=1)
if response.status_code is not 200:
return response.status_code
if not getattr(settings, 'CRUST_TASK_URL_3') == '':
json_body = provide_request_body(user_ldap_entry)
#headers = {'X-TENANT-ID': 'lui2backend', 'Authorization': 'Basic ' + base64.b64encode('crust:Unity-Grease-Cow-Sensitive-Despair-5'.encode()).decode()}
response = requests.get(getattr(settings, 'CRUST_TASK_URL_3'), timeout=1, data=json_body)
response = requests.post(getattr(settings, 'CRUST_TASK_URL_3'), timeout=1, data=json_body)
if response.status_code is not 200:
return response.status_code
......@@ -40,4 +40,4 @@ def provide_request_body(ldap_entry):
if LDAPEntryHelper.has_key(ldap_entry, attribute):
json_body[attribute] = LDAPEntryHelper.get_value(ldap_entry, attribute)
return json.dumps(json_body)
\ No newline at end of file
......@@ -9,19 +9,19 @@ class granted:
if not getattr(settings, 'CRUST_TASK_URL_1') == '':
json_body = provide_request_body(user_ldap_entry)
#headers = {'X-TENANT-ID': 'lui2backend', 'Authorization': 'Basic ' + base64.b64encode('crust:Unity-Grease-Cow-Sensitive-Despair-5'.encode()).decode()}
response = requests.get(getattr(settings, 'CRUST_TASK_URL_1'), data=json_body, timeout=1)
response = requests.post(getattr(settings, 'CRUST_TASK_URL_1'), data=json_body, timeout=1)
if response.status_code is not 200:
return response.status_code
if not getattr(settings, 'CRUST_TASK_URL_2') == '':
json_body = provide_request_body(user_ldap_entry)
#headers = {'X-TENANT-ID': 'lui2backend', 'Authorization': 'Basic ' + base64.b64encode('crust:Unity-Grease-Cow-Sensitive-Despair-5'.encode()).decode()}
response = requests.get(getattr(settings, 'CRUST_TASK_URL_2'), data=json_body, timeout=1)
response = requests.post(getattr(settings, 'CRUST_TASK_URL_2'), data=json_body, timeout=1)
if response.status_code is not 200:
return response.status_code
if not getattr(settings, 'CRUST_TASK_URL_3') == '':
json_body = provide_request_body(user_ldap_entry)
#headers = {'X-TENANT-ID': 'lui2backend', 'Authorization': 'Basic ' + base64.b64encode('crust:Unity-Grease-Cow-Sensitive-Despair-5'.encode()).decode()}
response = requests.get(getattr(settings, 'CRUST_TASK_URL_3'), timeout=1, data=json_body)
response = requests.post(getattr(settings, 'CRUST_TASK_URL_3'), timeout=1, data=json_body)
if response.status_code is not 200:
return response.status_code
......@@ -40,4 +40,4 @@ def provide_request_body(ldap_entry):
if LDAPEntryHelper.has_key(ldap_entry, attribute):
json_body[attribute] = LDAPEntryHelper.get_value(ldap_entry, attribute)
return json.dumps(json_body)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment