Skip to content

Commit

Permalink
Change /source/ to /sources/ in consent API paths
Browse files Browse the repository at this point in the history
  • Loading branch information
cassidysymons committed Dec 11, 2023
1 parent af93f97 commit 42eb9eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions microsetta_interface/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def _check_biospecimen_prereqs(acct_id, source_id, current_state=None):
# Test if biospecimen consent is required! If Required,
# route user to biospecimen consent
needs_reroute, consent_output, _ = ApiRequest.get(
'/accounts/%s/source/%s/consent/%s' %
'/accounts/%s/sources/%s/consent/%s' %
(acct_id, source_id, 'biospecimen'))

if needs_reroute:
Expand Down Expand Up @@ -1241,7 +1241,7 @@ def post_create_human_source(*, account_id=None, body=None):
# If source already exist, only latest consent
# needs to be signed. Sign the consent doc
has_error, consent_output, _ = ApiRequest.post(
"/accounts/{0}/source/{1}/consent/{2}".format(
"/accounts/{0}/sources/{1}/consent/{2}".format(
account_id, source_id, consent_type), json=body)

if has_error:
Expand All @@ -1266,7 +1266,7 @@ def post_create_human_source(*, account_id=None, body=None):

# Sign consent
has_error, consent_output, _ = ApiRequest.post(
"/accounts/{0}/source/{1}/consent/{2}".format(
"/accounts/{0}/sources/{1}/consent/{2}".format(
account_id, new_source_id, "data"), json=body)

if has_error:
Expand All @@ -1279,7 +1279,7 @@ def post_create_human_source(*, account_id=None, body=None):
consent_type = "biospecimen"

has_error, consent_output, _ = ApiRequest.post(
"/accounts/{0}/source/{1}/consent/{2}".format(
"/accounts/{0}/sources/{1}/consent/{2}".format(
account_id, source_id, consent_type), json=body)

if has_error:
Expand Down Expand Up @@ -3638,7 +3638,7 @@ def session_locale():

def check_current_consent(account_id, source_id, consent_type):
has_error, consent_required, _ = ApiRequest.get(
'/accounts/%s/source/%s/consent/%s' % (
'/accounts/%s/sources/%s/consent/%s' % (
account_id, source_id, consent_type
)
)
Expand Down
4 changes: 2 additions & 2 deletions microsetta_interface/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,13 @@ def test_duplicate_source_name(self):
return resp

def _sign_consent_document(self, acc_id, src_id, con_type, consent_data):
url = f'/accounts/{acc_id}/source/{src_id}/consent/{con_type}'
url = f'/accounts/{acc_id}/sources/{src_id}/consent/{con_type}'
resp = self.app.post(url, data=consent_data)
url = resp.headers['Location']
return self.app.get(url), url

def _is_consent_required(self, acc_id, source_id, consent_type):
url = f'/accounts/{acc_id}/source/{source_id}/consent/{consent_type}'
url = f'/accounts/{acc_id}/sources/{source_id}/consent/{consent_type}'
resp = self.app.get(url)
return resp["result"]

Expand Down

0 comments on commit 42eb9eb

Please sign in to comment.