From 70da01f3df5314b2ae2a933c7f84532fecc73fbf Mon Sep 17 00:00:00 2001 From: Cassidy Symons Date: Tue, 19 Sep 2023 16:53:27 -0700 Subject: [PATCH] Prevent minors from re-consenting --- microsetta_interface/implementation.py | 46 +++++++--- .../templates/minor_reconsent.jinja2 | 32 +++++++ .../es_ES/LC_MESSAGES/messages.po | 91 +++++++++++-------- .../es_MX/LC_MESSAGES/messages.po | 91 +++++++++++-------- 4 files changed, 173 insertions(+), 87 deletions(-) create mode 100644 microsetta_interface/templates/minor_reconsent.jinja2 diff --git a/microsetta_interface/implementation.py b/microsetta_interface/implementation.py index e5ea5e87..1f2fb652 100644 --- a/microsetta_interface/implementation.py +++ b/microsetta_interface/implementation.py @@ -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): diff --git a/microsetta_interface/templates/minor_reconsent.jinja2 b/microsetta_interface/templates/minor_reconsent.jinja2 new file mode 100644 index 00000000..80663faa --- /dev/null +++ b/microsetta_interface/templates/minor_reconsent.jinja2 @@ -0,0 +1,32 @@ +{% extends "sitebase.jinja2" %} +{% set page_title = _("Consent") %} +{% set show_breadcrumbs = True %} + +{% block head %} + +{% endblock %} + +{% block breadcrumb %} + + +{% endblock %} + +{% block content %} +
+ +
+{% endblock %} diff --git a/microsetta_interface/translations/es_ES/LC_MESSAGES/messages.po b/microsetta_interface/translations/es_ES/LC_MESSAGES/messages.po index c61e819f..fe94a2fe 100644 --- a/microsetta_interface/translations/es_ES/LC_MESSAGES/messages.po +++ b/microsetta_interface/translations/es_ES/LC_MESSAGES/messages.po @@ -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" @@ -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." @@ -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" @@ -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" @@ -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..." @@ -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" diff --git a/microsetta_interface/translations/es_MX/LC_MESSAGES/messages.po b/microsetta_interface/translations/es_MX/LC_MESSAGES/messages.po index 64b8b539..e8c502e7 100644 --- a/microsetta_interface/translations/es_MX/LC_MESSAGES/messages.po +++ b/microsetta_interface/translations/es_MX/LC_MESSAGES/messages.po @@ -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_MX\n" @@ -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." @@ -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" @@ -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" @@ -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..." @@ -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"