Skip to content

Commit

Permalink
Merge branch 'biocore:master' into report_overhaul_phase_1
Browse files Browse the repository at this point in the history
  • Loading branch information
ayobi authored Oct 29, 2024
2 parents 2619b87 + d8ff23c commit 3889b80
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
24 changes: 1 addition & 23 deletions microsetta_interface/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ def post_create_human_source(*, account_id=None, body=None):
return consent_output

session.pop(SOURCE_ID)

# Yes, "None" is coming through as a string in this instance, not as
# an actual None type.
if body["sample_ids"] != "None":
Expand Down Expand Up @@ -2731,9 +2732,6 @@ def get_ajax_check_activation_code(code, email):
return flask.jsonify(result)


# NB: associating surveys with samples when samples are claimed means that any
# surveys added to this source AFTER these samples are claimed will NOT be
# associated with these samples. This behavior is by design.
@prerequisite([SOURCE_PREREQS_MET, BIOSPECIMEN_PREREQS_MET])
def post_claim_samples(*, account_id=None, source_id=None, body=None,
sample_ids=None):
Expand Down Expand Up @@ -2763,19 +2761,6 @@ def post_claim_samples(*, account_id=None, source_id=None, body=None,
sample_ids=sample_ids
)

has_error, survey_output, _ = ApiRequest.get(
'/accounts/{0}/sources/{1}/surveys'.format(account_id, source_id))
if has_error:
return survey_output

# TODO: this will have to get more nuanced when we add animal surveys?
# Grab all primary and covid surveys from the source and associate with
# newly claimed samples; non-human sources always have none of these
survey_ids_to_associate_with_samples = [
x['survey_id'] for x in survey_output
if x['survey_template_id'] in [1, 6]
]

# TODO: Any of these requests may fail independently, but we don't
# have a good policy to deal with partial failures. Currently, we
# abort early but that will result in some set of associations being
Expand All @@ -2790,13 +2775,6 @@ def post_claim_samples(*, account_id=None, source_id=None, body=None,
if has_error:
return sample_output

# Associate the input answered surveys with this sample.
for survey_id in survey_ids_to_associate_with_samples:
sample_survey_output = _associate_sample_to_survey(
account_id, source_id, curr_sample_id, survey_id)
if sample_survey_output is not None:
return sample_survey_output

return redirect(
"/accounts/%s/sources/%s/kits" %
(account_id, source_id)
Expand Down
Binary file added microsetta_interface/static/img/sbi-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 10 additions & 2 deletions microsetta_interface/templates/home.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
background-color: #f1f1f2;
padding:2rem;
}
.sbi-logo {
max-width: 300px;
height: auto;
}
</style>
{% endblock %}

Expand All @@ -22,8 +26,12 @@
<div class="row h-25"></div>
<div class="row h-50">
<div class="col d-flex flex-column">
<div class="flex-fill">
<img src="/static/img/{{ _(EN_US_KEY) }}/the-microsetta-initiative-logo-rgb-1.png" srcset="/static/img/{{ _(EN_US_KEY) }}/the-microsetta-initiative-logo-rgb-1@2x.png 2x,/static/img/{{ _(EN_US_KEY) }}/the-microsetta-initiative-logo-rgb-1@3x.png 3x" />
<div class="flex-fill">
{% if request.args.get('project') == 'sbi' %}
<img class="sbi-logo" src="/static/img/sbi-logo.png" alt="Skin Biome Initiative Logo" />
{% else %}
<img src="/static/img/{{ _(EN_US_KEY) }}/the-microsetta-initiative-logo-rgb-1.png" srcset="/static/img/{{ _(EN_US_KEY) }}/the-microsetta-initiative-logo-rgb-1@2x.png 2x, /static/img/{{ _(EN_US_KEY) }}/the-microsetta-initiative-logo-rgb-1@3x.png 3x" />
{% endif %}
</div>

<div class="flex-fill mt-3">
Expand Down

0 comments on commit 3889b80

Please sign in to comment.