Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Minors from Re-consenting #291

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 31 additions & 15 deletions microsetta_interface/implementation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,22 +1651,38 @@ def render_consent_page(account_id, source_id, form_type, sample_ids=None,
# biospecimen consent
skip_dupe_check = True

return _render_with_defaults(
'new_participant.jinja2',
tl=consent_output,
post_url=post_url,
duplicate_source_check=duplicate_source_check,
home_url=home_url,
form_type=form_type,
reconsent=reconsent,
language_tag=session_locale(),
sample_ids=sample_ids,
participant_name=source_output['source_name'],
age_range=source_output['consent']['age_range'],
account_id=account_id,
source_id=source_id,
skip_dupe_check=skip_dupe_check
# NB: For the time being, we need to block any existing under-18 profiles
# from reconsenting. Checking whether they have a current data consent is
# an absolute way to establish old profiles vs. new, so we'll see if they
# have the current data consent, then divert anyone under 18 away from the
# reconsent form.
need_reconsent_data = check_current_consent(
account_id, source_id, "data"
)
if need_reconsent_data and source_output['consent']['age_range'] !=\
"legacy" and source_output['consent']['age_range'] != "18-plus":
return _render_with_defaults(
'minor_reconsent.jinja2',
account_id=account_id,
source_id=source_id
)
else:
return _render_with_defaults(
'new_participant.jinja2',
tl=consent_output,
post_url=post_url,
duplicate_source_check=duplicate_source_check,
home_url=home_url,
form_type=form_type,
reconsent=reconsent,
language_tag=session_locale(),
sample_ids=sample_ids,
participant_name=source_output['source_name'],
age_range=source_output['consent']['age_range'],
account_id=account_id,
source_id=source_id,
skip_dupe_check=skip_dupe_check
)


def decline_reconsent(*, account_id, source_id):
Expand Down
32 changes: 32 additions & 0 deletions microsetta_interface/templates/minor_reconsent.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{% extends "sitebase.jinja2" %}
{% set page_title = _("Consent") %}
{% set show_breadcrumbs = True %}

{% block head %}
<script type="text/javascript">
function goHome() {
window.location.replace("/accounts/{{ account_id |e }}/sources/{{ source_id |e }}/decline_reconsent");
}
</script>
{% endblock %}

{% block breadcrumb %}
<li class="breadcrumb-item"><a href="/accounts/{{account_id}}">{{ _('Dashboard') }}</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ _('My Profile') }}</li>
{% endblock %}

{% block content %}
<center>
<div class="card card-account" style="max-width: 800px; text-align: left;">
<div class="card-body">
{{ _('Unfortunately, profiles for minors are currently unavailable for updates as we make adjustments to the process of agreeing to our updated consent documents. You may view existing survey responses, samples, and reports, but updating survey responses or contributing new samples is disabled. We anticipate re-enabling these features within the next few weeks.') }}
<br /><br />
{{ _('Please click the Continue button below to go to your profile.') }}
<br /><br />
<center>
<input type="button" id="cancel_button" value="{{ _('Continue') }}" class="btn btn-white-blue-border me-4" onClick="goHome()">
</center>
</div>
</div>
</center>
{% endblock %}
91 changes: 55 additions & 36 deletions microsetta_interface/translations/es_ES/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2023-09-12 16:00-0700\n"
"POT-Creation-Date: 2023-09-19 16:51-0700\n"
"PO-Revision-Date: 2023-06-16 12:25-0800\n"
"Last-Translator: \n"
"Language: es_ES\n"
Expand All @@ -29,83 +29,83 @@ msgstr ""
msgid "SKIP"
msgstr "Saltar"

#: implementation.py:2196 model_i18n.py:69
#: implementation.py:2212 model_i18n.py:69
msgid "Blood (skin prick)"
msgstr "Sangre (punción cutánea)"

#: implementation.py:2197 model_i18n.py:70
#: implementation.py:2213 model_i18n.py:70
msgid "Saliva"
msgstr "Saliva"

#: implementation.py:2198 model_i18n.py:82
#: implementation.py:2214 model_i18n.py:82
msgid "Stool"
msgstr "Heces"

#: implementation.py:2199 model_i18n.py:77
#: implementation.py:2215 model_i18n.py:77
msgid "Mouth"
msgstr "Boca"

#: implementation.py:2200 model_i18n.py:78
#: implementation.py:2216 model_i18n.py:78
msgid "Nares"
msgstr "Fosas nasales"

#: implementation.py:2201 model_i18n.py:79
#: implementation.py:2217 model_i18n.py:79
msgid "Nasal mucus"
msgstr "Moco nasal"

#: implementation.py:2202 model_i18n.py:80
#: implementation.py:2218 model_i18n.py:80
msgid "Right hand"
msgstr "Mano derecha"

#: implementation.py:2203 model_i18n.py:75
#: implementation.py:2219 model_i18n.py:75
msgid "Left hand"
msgstr "Mano izquierda"

#: implementation.py:2204 model_i18n.py:72
#: implementation.py:2220 model_i18n.py:72
msgid "Forehead"
msgstr "Frente"

#: implementation.py:2205 model_i18n.py:84
#: implementation.py:2221 model_i18n.py:84
msgid "Torso"
msgstr "Torso"

#: implementation.py:2206 model_i18n.py:81
#: implementation.py:2222 model_i18n.py:81
msgid "Right leg"
msgstr "Pierna derecha"

#: implementation.py:2207 model_i18n.py:76
#: implementation.py:2223 model_i18n.py:76
msgid "Left leg"
msgstr "Pierna izquierda"

#: implementation.py:2208 model_i18n.py:85
#: implementation.py:2224 model_i18n.py:85
msgid "Vaginal mucus"
msgstr "Moco vaginal"

#: implementation.py:2209 model_i18n.py:83
#: implementation.py:2225 model_i18n.py:83
msgid "Tears"
msgstr "Lágrimas"

#: implementation.py:2210 model_i18n.py:71
#: implementation.py:2226 model_i18n.py:71
msgid "Ear wax"
msgstr "Cera de oído"

#: implementation.py:2211 model_i18n.py:74
#: implementation.py:2227 model_i18n.py:74
msgid "Hair"
msgstr "Cabello"

#: implementation.py:2212 model_i18n.py:73
#: implementation.py:2228 model_i18n.py:73
msgid "Fur"
msgstr "Piel"

#: implementation.py:2550
#: implementation.py:2566
msgid "Unable to validate Activation Code at this time"
msgstr "No se ha podido validar el código de activación en este momento"

#: implementation.py:2865
#: implementation.py:2881
msgid "Address 1, Postal Code, and Country are required"
msgstr "Dirección 1, Código Postal y País son requeridos"

#: implementation.py:3277 implementation.py:3395
#: implementation.py:3293 implementation.py:3411
msgid "Sorry, there was a problem saving your information."
msgstr "Lo sentimos, hubo un problema al guardar su información."

Expand Down Expand Up @@ -263,10 +263,11 @@ msgstr "Código Postal"

#: templates/account_details.jinja2:109 templates/account_overview.jinja2:44
#: templates/consents.jinja2:22 templates/kits.jinja2:178
#: templates/new_participant.jinja2:206 templates/new_results_page.jinja2:1340
#: templates/nutrition.jinja2:107 templates/reports.jinja2:61
#: templates/sample.jinja2:183 templates/signed_consent.jinja2:8
#: templates/source.jinja2:56 templates/survey.jinja2:182
#: templates/minor_reconsent.jinja2:14 templates/new_participant.jinja2:206
#: templates/new_results_page.jinja2:1340 templates/nutrition.jinja2:107
#: templates/reports.jinja2:61 templates/sample.jinja2:183
#: templates/signed_consent.jinja2:8 templates/source.jinja2:56
#: templates/survey.jinja2:182
msgid "Dashboard"
msgstr "Panel"

Expand Down Expand Up @@ -1921,6 +1922,35 @@ msgstr "¿Qué es el código de barras y por qué es importante?"
msgid "Confirm"
msgstr "Confirmar"

#: templates/minor_reconsent.jinja2:2 templates/new_participant.jinja2:2
#: templates/signed_consent.jinja2:2
msgid "Consent"
msgstr "Consentimiento Informado"

#: templates/minor_reconsent.jinja2:15 templates/nutrition.jinja2:137
#: templates/signed_consent.jinja2:9 templates/sitebase.jinja2:205
#: templates/sitebase.jinja2:214 templates/sitebase.jinja2:216
#: templates/source.jinja2:2 templates/survey.jinja2:183
msgid "My Profile"
msgstr "Mi Perfil"

#: templates/minor_reconsent.jinja2:22
msgid ""
"Unfortunately, profiles for minors are currently unavailable for updates "
"as we make adjustments to the process of agreeing to our updated consent "
"documents. You may view existing survey responses, samples, and reports, "
"but updating survey responses or contributing new samples is disabled. We"
" anticipate re-enabling these features within the next few weeks."
msgstr "Desafortunadamente, los perfiles de menores de edad actualmente no están disponibles para actualizaciones, ya que realizamos cambios en el proceso de aceptación de nuestros documentos de consentimiento. Usted puede ver respuestas de encuestas existentes, muestras e informes, pero la actualización de respuestas en las encuestas o la contribución de nuevas muestras están deshabilitadas. Anticipamos volver a habilitar estas funciones en las próximas semanas."

#: templates/minor_reconsent.jinja2:24
msgid "Please click the Continue button below to go to your profile."
msgstr "Por favor, haga clic en el siguiente botón de Continuar para ir a su perfil."

#: templates/minor_reconsent.jinja2:27
msgid "Continue"
msgstr "Continuar"

#: templates/myfoodrepo_no_slots.jinja2:2
msgid "MyFoodRepo unavailable"
msgstr "MyFoodRepo no disponible"
Expand Down Expand Up @@ -1954,10 +1984,6 @@ msgstr ""
msgid "Back to Samples"
msgstr "Volver a las Muestras"

#: templates/new_participant.jinja2:2 templates/signed_consent.jinja2:2
msgid "Consent"
msgstr "Consentimiento Informado"

#: templates/new_participant.jinja2:46 templates/new_participant.jinja2:47
#: templates/new_participant.jinja2:48 templates/new_participant.jinja2:49
msgid "Saving..."
Expand Down Expand Up @@ -2976,13 +3002,6 @@ msgstr ""
"comienza su FFQ sin proporcionar su altura, peso, edad y sexo en la "
"encuesta de Información Básica, su informe FFQ será inexacto."

#: templates/nutrition.jinja2:137 templates/signed_consent.jinja2:9
#: templates/sitebase.jinja2:205 templates/sitebase.jinja2:214
#: templates/sitebase.jinja2:216 templates/source.jinja2:2
#: templates/survey.jinja2:183
msgid "My Profile"
msgstr "Mi Perfil"

#: templates/nutrition.jinja2:149
msgid "Have an FFQ"
msgstr "Tiene un FFQ"
Expand Down
Loading
Loading