From 1776b9059bd9882582a05e4a65cecb7eb9a6aa8f Mon Sep 17 00:00:00 2001 From: miquelvir <41950283+miquelvir@users.noreply.github.com> Date: Sat, 13 Jul 2024 10:57:30 +0200 Subject: [PATCH] feat: 3rd party image legal check --- .../manual_db_utils/generate_sample_db.py | 1 + requirements.txt | 2 +- .../course_students_contact_sheet.py | 1 + server/models/student.py | 1 + server/pdfs/templates/enrolment.html | 4 +++ server_tests/mothers/student_mother.py | 2 ++ .../src/PreEnrolmentPage/PreEnrolmentPage.js | 29 ++++++++++++++++--- .../students.student.attendee.component.js | 11 ++++++- web_app/src/_data/empty_objects.js | 1 + .../locales/cat/translation.json | 1 + .../locales/eng/translation.json | 1 + 11 files changed, 48 insertions(+), 6 deletions(-) diff --git a/development/manual_db_utils/generate_sample_db.py b/development/manual_db_utils/generate_sample_db.py index 23e29e9f..dc095839 100644 --- a/development/manual_db_utils/generate_sample_db.py +++ b/development/manual_db_utils/generate_sample_db.py @@ -188,6 +188,7 @@ def generate_student(idx): enrolment_status=choice(("enrolled", "early-unenrolled", "pre-enrolled")), years_in_xamfra=randint(0, 15), image_agreement=choice((True, False)), + image_agreement_external=choice((True, False)), ) diff --git a/requirements.txt b/requirements.txt index a4a0feba..49d347d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -42,7 +42,7 @@ pathspec==0.9.0 pdfkit==0.6.1 platformdirs==2.5.2 pluggy==0.13.1 -psycopg2==2.9.1 +psycopg2-binary==2.9.1 py==1.10.0 pycparser==2.20 pycryptodomex==3.14.1 diff --git a/server/blueprints/api/resources/course_students_contact_sheet.py b/server/blueprints/api/resources/course_students_contact_sheet.py index ea0e482d..51abbfc8 100644 --- a/server/blueprints/api/resources/course_students_contact_sheet.py +++ b/server/blueprints/api/resources/course_students_contact_sheet.py @@ -100,6 +100,7 @@ def write_students(students, spamwriter): student.price_term, student.gender, student.image_agreement, + student.image_agreement_external, student.payment_comments, student.default_payment_method, student.dni, diff --git a/server/models/student.py b/server/models/student.py index d2097840..25947cab 100644 --- a/server/models/student.py +++ b/server/models/student.py @@ -28,6 +28,7 @@ class Student(Person): payment_comments = db.Column(db.Text, nullable=True) other_comments = db.Column(db.Text, nullable=True) image_agreement = db.Column(db.Boolean, nullable=False, default=False) + image_agreement_external = db.Column(db.Boolean, nullable=False, default=False) birth_date = db.Column(db.Date, nullable=True) enrolment_status = db.Column(db.Text, nullable=False) diff --git a/server/pdfs/templates/enrolment.html b/server/pdfs/templates/enrolment.html index 3640b728..e548c9a9 100644 --- a/server/pdfs/templates/enrolment.html +++ b/server/pdfs/templates/enrolment.html @@ -198,6 +198,10 @@
PAGAMENT | PAGO | PAYMENT

{% endif %} + + +
+
diff --git a/server_tests/mothers/student_mother.py b/server_tests/mothers/student_mother.py index f81cb722..38dff479 100644 --- a/server_tests/mothers/student_mother.py +++ b/server_tests/mothers/student_mother.py @@ -24,6 +24,7 @@ def adult_anna() -> dict: return { **JsonPersonMother.adult_anna(), "image_agreement": True, + "image_agreement_external": True, "country_of_origin": "ES", "gender": "m", "birth_date": "2001-01-01", @@ -40,6 +41,7 @@ def child_mark(cls) -> dict: return { **JsonPersonMother.child_mark(), "image_agreement": True, + "image_agreement_external": True, "country_of_origin": "ES", "gender": "m", "birth_date": "2005-05-05", diff --git a/web_app/src/PreEnrolmentPage/PreEnrolmentPage.js b/web_app/src/PreEnrolmentPage/PreEnrolmentPage.js index 7fb6f486..100755d2 100644 --- a/web_app/src/PreEnrolmentPage/PreEnrolmentPage.js +++ b/web_app/src/PreEnrolmentPage/PreEnrolmentPage.js @@ -192,7 +192,8 @@ __person1__surname1: '', __person2__email: '', __person2__phone: '', __person2__relation: '', __person2__is_studying: '', __person2__is_working: '', __person2__career: '', __person2__education_entity: '', __person2__education_year: '', - image_agreement: false + image_agreement: false, + image_agreement_external: false }, @@ -322,7 +323,8 @@ __person1__surname1: '', is: true, then: yup.string().required(required) }), - image_agreement: yup.boolean(required) + image_agreement: yup.boolean(required), + image_agreement_external: yup.boolean(required) }), enableReinitialize: true, onSubmit: (values, {setStatus, setSubmitting}) => { @@ -331,6 +333,7 @@ __person1__surname1: '', let body = {}; body['image_agreement'] = values.image_agreement; + body['image_agreement_external'] = values.image_agreement_external; body['name'] = values.name; body['surname1'] = values.surname1; body['surname2'] = values.surname2; @@ -409,7 +412,7 @@ __person1__surname1: '', ['birth_date', 'name', 'surname1', 'surname2', 'address', 'city', 'zip', 'gender', 'is_studying', 'is_working', 'education_entity', 'education_year', 'career', 'years_in_xamfra', 'country_of_origin', 'phone', 'email'], ['__person1__name', '__person1__surname1', '__person1__surname2', '__person1__email', '__person1__phone', '__person1__phone', '__person1__relation', '__person1__is_studying', '__person1__education_entity', '__person1__education_year', '__person1__is_working', '__person1__career'], ['__person2__name', '__person2__surname1', '__person2__surname2', '__person2__email', '__person2__phone', '__person2__phone', '__person2__relation', '__person2__is_studying', '__person2__education_entity', '__person2__education_year', '__person2__is_working', '__person2__career'], - [], [], ['image_agreement'], []]; + [], [], ['image_agreement', 'image_agreement_external'], []]; const scrollToTop = () => { window.scrollTo(0,0); @@ -511,7 +514,7 @@ __person1__surname1: '', Enviar aquest formulari implica consentiment per fer ús de les dades per tal de rebre informació durant el període de preinscripció i inici de curs. -La posterior matrícula presencial al centre implica també l'ús de les dades durant tot el curs 2023-2024. +La posterior matrícula presencial al centre implica també l'ús de les dades durant tot el curs 2024-2025. La nostra política protecció de dades es basa en que: @@ -1059,6 +1062,24 @@ La nostra política protecció de dades es basa en que: "En cas de matricular-lo, autoritzo l’ús de la imatge de l’estudiant, menor d'edat, per a que pugui aparèixer a materials escrits o multimèdia corresponents a activitats educatives organitzades per Xamfrà." : "En cas de matricular-me, autoritzo l’ús de la meva imatge per a que pugui aparèixer a materials escrits o multimèdia corresponents a activitats educatives organitzades per Xamfrà." } /> + + + + + } + key={'image_agreement_external'} + label={"En cas de matricular-me, autoritzo l’ús de la meva imatge i/o la dels meus fills/es matriculats per a que puguin aparèixer a materials escrits o multimèdia corresponents a activitats organitzades per terceres persones autoritzades per L’ARC Música i sobre la possibilitat de publicar imatges on apareguin clarament identificables els seus fills/es. Aquest material mai podrà ser utilitzat amb finalitats lucratives." } + /> {t("yes")} {t("no")} - + , + + {t("yes")} + {t("no")} + ], [