From b60b339c99f2c69c485b2c97f2ef83ae4ba315db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Thu, 17 Mar 2022 11:27:33 +0100 Subject: [PATCH 01/17] Add and save database field "is_private_org" --- aidants_connect_habilitation/forms.py | 9 +++++++++ ...0013_organisationrequest_is_private_org.py | 18 ++++++++++++++++++ aidants_connect_habilitation/models.py | 2 +- .../templates/organisation_form.html | 19 ++++--------------- 4 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index e7f1a32ee..32a6ca344 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -96,6 +96,14 @@ class OrganisationRequestForm(PatchedErrorListForm): }, ) + is_private_org = BooleanField( + label=( + "Cochez cette case si vous faites cette demande pour une structure privée " + "(hors associations)" + ), + required=False, + ) + partner_administration = CharField( label="Renseignez l’administration avec laquelle vous travaillez", required=False, @@ -152,6 +160,7 @@ class Meta: "address", "zipcode", "city", + "is_private_org", "partner_administration", "public_service_delegation_attestation", "france_services_label", diff --git a/aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py b/aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py new file mode 100644 index 000000000..f7bd1b98a --- /dev/null +++ b/aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.12 on 2022-03-17 10:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('aidants_connect_habilitation', '0012_auto_20220314_1530'), + ] + + operations = [ + migrations.AddField( + model_name='organisationrequest', + name='is_private_org', + field=models.BooleanField(default=False, verbose_name='Structure privée'), + ), + ] diff --git a/aidants_connect_habilitation/models.py b/aidants_connect_habilitation/models.py index 5cd7237e6..de0e10bef 100644 --- a/aidants_connect_habilitation/models.py +++ b/aidants_connect_habilitation/models.py @@ -222,13 +222,13 @@ class OrganisationRequest(models.Model): zipcode = models.CharField("Code Postal", max_length=10) city = models.CharField("Ville", max_length=255, blank=True) + is_private_org = models.BooleanField("Structure privée", default=False) partner_administration = models.CharField( "Administration partenaire", blank=True, default="", max_length=200, ) - public_service_delegation_attestation = models.FileField( "Attestation de délégation de service public", blank=True, diff --git a/aidants_connect_habilitation/templates/organisation_form.html b/aidants_connect_habilitation/templates/organisation_form.html index 1ee9284b0..7ec005639 100644 --- a/aidants_connect_habilitation/templates/organisation_form.html +++ b/aidants_connect_habilitation/templates/organisation_form.html @@ -13,14 +13,13 @@

Structure d’accueil

Vous pouvez faire autant de demandes qu’il existe de structures d’accueil.

-

Informations générales

{% csrf_token %} {{ form.non_field_errors }} @@ -57,20 +56,10 @@

Informations administratives

{% field_as_fr_grid_row form.siret %} -
-
- - -
-
- + {% checkbox_fr_grid_row form.is_private_org %}
{% field_as_fr_grid_row form.partner_administration %} - {% field_as_fr_grid_row form.public_service_delegation_attestation %}

Informations descriptives

From 64de5e56dc62d21080539c7e851332adebce1b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Thu, 17 Mar 2022 11:48:15 +0100 Subject: [PATCH 02/17] Display block "public service delegation" only if checkbox is checked --- aidants_connect_habilitation/forms.py | 7 +++++++ .../static/js/organisation_form.js | 15 ++++++++++++++- .../templates/organisation_form.html | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 32a6ca344..347afe483 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -133,6 +133,13 @@ def __init__(self, **kwargs): "data-other-value": RequestOriginConstants.OTHER.value, }, ) + self.widget_attrs( + "is_private_org", + { + "data-action": "change->dynamic-form#onIsPrivateOrgChange", + "data-dynamic-form-target": "privateOrgInput", + }, + ) def clean_type(self): return OrganisationType.objects.get(pk=int(self.data["type"])) diff --git a/aidants_connect_habilitation/static/js/organisation_form.js b/aidants_connect_habilitation/static/js/organisation_form.js index 92c2bcee1..8ba3408b5 100644 --- a/aidants_connect_habilitation/static/js/organisation_form.js +++ b/aidants_connect_habilitation/static/js/organisation_form.js @@ -6,12 +6,25 @@ Object.assign(DynamicForm.prototype, { "connect": function connect() { this.selectOrgType(this.typeInputTarget.value); + this.showHide(this.onlyShownIfPrivateOrgTarget, this.privateOrgInputTarget.checked); }, "onTypeChange": function onTypeChange(evt) { this.selectOrgType(evt.target.value); }, + "onIsPrivateOrgChange": function onIsPrivateOrgChange(evt) { + this.showHide(this.onlyShownIfPrivateOrgTarget, evt.target.checked); + }, + + "showHide": function showHide(element, show) { + if (show) { + element.removeAttribute("hidden"); + } else { + element.setAttribute("hidden", "hidden"); + } + }, + "selectOrgType": function selectOrgType(value) { if (value === this.typeInputTarget.dataset.otherValue) { this.showTypeOtherInputContainer(); @@ -32,7 +45,7 @@ }); /* Static fields */ - DynamicForm.targets = ["typeOtherInputContainer", "typeOtherInput", "typeInput"]; + DynamicForm.targets = ["typeOtherInputContainer", "typeOtherInput", "typeInput", "onlyShownIfPrivateOrg", "privateOrgInput"]; function init() { const application = Stimulus.Application.start(); diff --git a/aidants_connect_habilitation/templates/organisation_form.html b/aidants_connect_habilitation/templates/organisation_form.html index 7ec005639..20239a7cc 100644 --- a/aidants_connect_habilitation/templates/organisation_form.html +++ b/aidants_connect_habilitation/templates/organisation_form.html @@ -58,7 +58,7 @@

Informations administratives

{% checkbox_fr_grid_row form.is_private_org %} -
+
{% field_as_fr_grid_row form.partner_administration %}
From c4196e21833a6dec1c3a9e3c37d43c2b88f134cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 18 Mar 2022 17:20:01 +0100 Subject: [PATCH 03/17] Add and stylish field "france services number" --- aidants_connect_habilitation/forms.py | 1 + ...ivate_org.py => 0013_auto_20220318_1704.py} | 7 ++++++- aidants_connect_habilitation/models.py | 6 ++++++ .../static/scss/main-habilitation.scss | 18 +++++++++++++++++- .../templates/organisation_form.html | 6 ++++-- 5 files changed, 34 insertions(+), 4 deletions(-) rename aidants_connect_habilitation/migrations/{0013_organisationrequest_is_private_org.py => 0013_auto_20220318_1704.py} (56%) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 347afe483..09e727678 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -171,6 +171,7 @@ class Meta: "partner_administration", "public_service_delegation_attestation", "france_services_label", + "france_services_number", "web_site", "mission_description", "avg_nb_demarches", diff --git a/aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py b/aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py similarity index 56% rename from aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py rename to aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py index f7bd1b98a..7064ab3bf 100644 --- a/aidants_connect_habilitation/migrations/0013_organisationrequest_is_private_org.py +++ b/aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.12 on 2022-03-17 10:13 +# Generated by Django 3.2.12 on 2022-03-18 16:04 from django.db import migrations, models @@ -10,6 +10,11 @@ class Migration(migrations.Migration): ] operations = [ + migrations.AddField( + model_name='organisationrequest', + name='france_services_number', + field=models.CharField(blank=True, default='', max_length=200, verbose_name='Numéro d’immatriculation France Services'), + ), migrations.AddField( model_name='organisationrequest', name='is_private_org', diff --git a/aidants_connect_habilitation/models.py b/aidants_connect_habilitation/models.py index de0e10bef..08c3f3e31 100644 --- a/aidants_connect_habilitation/models.py +++ b/aidants_connect_habilitation/models.py @@ -238,6 +238,12 @@ class OrganisationRequest(models.Model): france_services_label = models.BooleanField( "Labellisation France Services", default=False ) + france_services_number = models.CharField( + "Numéro d’immatriculation France Services", + blank=True, + default="", + max_length=200, + ) web_site = models.URLField("Site web", blank=True, default="") diff --git a/aidants_connect_habilitation/static/scss/main-habilitation.scss b/aidants_connect_habilitation/static/scss/main-habilitation.scss index 31895a3ec..5bffa061f 100644 --- a/aidants_connect_habilitation/static/scss/main-habilitation.scss +++ b/aidants_connect_habilitation/static/scss/main-habilitation.scss @@ -373,10 +373,26 @@ fieldset { transform: translateY(3rem); } -.partner-administration { +.grey-background { background: #f2f2f2; padding: 1rem; margin: 1rem 0; + + &.shown-on-checkbox { + position: relative; + + &::before { + position: absolute; + content: ""; + width: 1.5rem; + height: 1.5rem; + background: #f2f2f2; + transform: rotate(45deg); + left: 0.2rem; + top: -.6rem; + border-radius: 0 0 100% 0; + } + } } .form-in-3-cols { diff --git a/aidants_connect_habilitation/templates/organisation_form.html b/aidants_connect_habilitation/templates/organisation_form.html index 20239a7cc..4f54cc614 100644 --- a/aidants_connect_habilitation/templates/organisation_form.html +++ b/aidants_connect_habilitation/templates/organisation_form.html @@ -58,7 +58,7 @@

Informations administratives

{% checkbox_fr_grid_row form.is_private_org %} -
+
{% field_as_fr_grid_row form.partner_administration %}
@@ -72,13 +72,15 @@

Autres caractéristiques de la structure

{% checkbox_fr_grid_row form.france_services_label %} +
+ {% field_as_fr_grid_row form.france_services_number %} +
-
From a29f5715c11a7e11f735e0a29fc5473edd6ba70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 18 Mar 2022 17:28:49 +0100 Subject: [PATCH 04/17] Plug form "france services number" on JS --- aidants_connect_habilitation/forms.py | 7 +++++++ .../static/js/organisation_form.js | 7 ++++++- .../templates/organisation_form.html | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 09e727678..ee946661c 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -140,6 +140,13 @@ def __init__(self, **kwargs): "data-dynamic-form-target": "privateOrgInput", }, ) + self.widget_attrs( + "france_services_label", + { + "data-action": "change->dynamic-form#onFranceServicesChange", + "data-dynamic-form-target": "franceServicesInput", + }, + ) def clean_type(self): return OrganisationType.objects.get(pk=int(self.data["type"])) diff --git a/aidants_connect_habilitation/static/js/organisation_form.js b/aidants_connect_habilitation/static/js/organisation_form.js index 8ba3408b5..fb1a203af 100644 --- a/aidants_connect_habilitation/static/js/organisation_form.js +++ b/aidants_connect_habilitation/static/js/organisation_form.js @@ -7,6 +7,7 @@ "connect": function connect() { this.selectOrgType(this.typeInputTarget.value); this.showHide(this.onlyShownIfPrivateOrgTarget, this.privateOrgInputTarget.checked); + this.showHide(this.onlyShownIfFranceServicesTarget, this.franceServicesInputTarget.checked); }, "onTypeChange": function onTypeChange(evt) { @@ -17,6 +18,10 @@ this.showHide(this.onlyShownIfPrivateOrgTarget, evt.target.checked); }, + "onFranceServicesChange": function truc(evt) { + this.showHide(this.onlyShownIfFranceServicesTarget, evt.target.checked) + }, + "showHide": function showHide(element, show) { if (show) { element.removeAttribute("hidden"); @@ -45,7 +50,7 @@ }); /* Static fields */ - DynamicForm.targets = ["typeOtherInputContainer", "typeOtherInput", "typeInput", "onlyShownIfPrivateOrg", "privateOrgInput"]; + DynamicForm.targets = ["typeOtherInputContainer", "typeOtherInput", "typeInput", "onlyShownIfPrivateOrg", "privateOrgInput", "franceServicesInput", "onlyShownIfFranceServices"]; function init() { const application = Stimulus.Application.start(); diff --git a/aidants_connect_habilitation/templates/organisation_form.html b/aidants_connect_habilitation/templates/organisation_form.html index 4f54cc614..54645ff38 100644 --- a/aidants_connect_habilitation/templates/organisation_form.html +++ b/aidants_connect_habilitation/templates/organisation_form.html @@ -72,7 +72,7 @@

Autres caractéristiques de la structure

{% checkbox_fr_grid_row form.france_services_label %} -
+
{% field_as_fr_grid_row form.france_services_number %}
From 480129b1b1839af8c26a5139965aad3851092e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 18 Mar 2022 18:01:04 +0100 Subject: [PATCH 05/17] Commit generated css files --- aidants_connect_habilitation/static/css/main-habilitation.css | 2 +- .../static/css/main-habilitation.css.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aidants_connect_habilitation/static/css/main-habilitation.css b/aidants_connect_habilitation/static/css/main-habilitation.css index 115f717db..2660894df 100644 --- a/aidants_connect_habilitation/static/css/main-habilitation.css +++ b/aidants_connect_habilitation/static/css/main-habilitation.css @@ -1 +1 @@ -html,body{height:100%}ul,ol{margin:0;padding:0}svg.previews{display:none}#main{overflow:hidden}main a[href]{color:#ef4056;font-weight:bold}:focus-visible{background:#fad776;color:#333 !important;outline:2px solid #fad776;border-radius:2px}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.text-l{font-size:1.5rem}.shadowed{border:1px solid #fad776;box-sizing:border-box;box-shadow:10px 10px 0 #fad776;padding:2rem}.shadowed.grey{box-shadow:10px 10px 0 #c5c5c5;border-color:#c5c5c5}h1,.h1{font-size:3rem;font-weight:bold;color:#ef4056;margin:2.5rem 0;text-transform:uppercase;line-height:1.25}h1+.subtitle,.h1+.subtitle{font-size:1.5rem;color:#5770be}h2,.h2{font-size:2.25rem;color:#1b4991;font-weight:bold;text-transform:uppercase;margin:2rem 0;line-height:1.25}h2+.subtitle,.h2+.subtitle{margin-top:-1.5rem;margin-bottom:2rem}h2:first-child,legend+h2,.h2:first-child,legend+.h2{margin-top:0}h3,.h3{font-size:1.5rem;color:#5770be;font-weight:normal;margin:2.5rem 0 1.5rem;line-height:1.25}h3:first-child,legend+h3,.h3:first-child,legend+.h3{margin-top:0}.shadowed .h2,.shadowed .h3{font-size:1.125rem}.more-info{font-style:italic;color:#5770be;margin-top:4rem}details{border:1px solid #1b4991}details summary{background:#1b4991 no-repeat url("../img/plus-w.svg") 98% 50%;color:#fff;cursor:pointer;padding:1rem 3rem 1rem 1rem}details summary::marker{content:""}details summary:before{background:#fad776;border-radius:100%;color:#1b4991;content:"!";display:inline-block;font-size:1.7rem;font-weight:bold;height:2rem;margin-right:1rem;text-align:center;width:2rem}details[open] summary{background-image:url("../img/x.svg")}details .details-content{padding:0 1rem}input[type=text],input[type=number],input[type=email],input[type=tel],input[type=url]{border:1px solid #5770be;font-family:"Marianne",arial,sans-serif;font-size:1rem;line-height:2.25;padding:0 .5rem;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=tel]:focus,input[type=url]:focus{border-color:#fad776;background:#fad776}select{border:1px solid #5770be;border-radius:0;font-family:"Marianne",arial,sans-serif;font-size:1rem;padding:0 .5rem;background:#fff url(../img/dropdown.svg) no-repeat 98% 56%;max-width:100%;height:2.25rem;-webkit-appearance:none;appearance:none}select:focus{border-color:#fad776;background-color:#fad776}textarea{border:1px solid #5770be;background:#fff;width:100%;resize:vertical;font-family:"Marianne",arial,sans-serif;padding:.5rem;line-height:1.25}textarea:focus{border-color:#fad776;background:#fad776}input[type=checkbox],input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:1.5rem;width:1.5rem;min-width:1.5rem;padding:0;margin:0 1rem 0 0;position:relative;border:1px solid #5770be;vertical-align:middle}input[type=checkbox]:before,input[type=radio]:before{transform:scale(0);content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:url("../img/x.svg") 50% no-repeat}input[type=checkbox]:checked:before,input[type=radio]:checked:before{transform:scale(1)}input[type=radio]{border-radius:100%}input[type=radio]:checked:before{background:#333;border-radius:100%;border:4px solid #fff}button,.button{background:#fff;border:1px solid #ef4056;color:#ef4056;cursor:pointer;display:inline-block;font-family:"Marianne",arial,sans-serif;font-size:1rem;font-weight:bold;line-height:1.3;margin:0;padding:.75rem;text-decoration:none;vertical-align:baseline}button.primary,.button.primary{background:#ef4056;color:#fff}button:focus-visible,.button:focus-visible{background:#fad776;color:#333}fieldset{border:none;padding:0;margin:0}.form-grid-row label:only-child,.form-grid-row input{width:100%}.form-grid-row input[type=checkbox],.form-grid-row input[type=radio]{width:1.5rem}.checkbox-col{display:flex;align-items:center}.fr-col-md-2.zipcode-container{padding-right:0}.form-grid-row.form-grid-row-error input{border-color:#ef4056}.fr-grid-row--gutters .errors{padding-top:.25rem;padding-bottom:1.5rem;font-size:.75rem;line-height:1.25;color:#e9133e}.fr-grid-row--gutters .errors>p{margin:0}.help-text{margin-top:0;font-size:.9rem;color:#666}.button-box{display:flex;justify-content:space-between}.button-box>:only-child{margin-left:auto}.button-box.standalone{margin-top:4rem}.shadowed .button-box{transform:translateY(4rem)}.form-in-3-cols .shadowed .button-box{transform:translateY(3rem)}.partner-administration{background:#f2f2f2;padding:1rem;margin:1rem 0}.form-in-3-cols .shadowed{padding:1rem;height:100%}.form-in-3-cols .shadowed.with-button-box{display:flex;flex-direction:column;justify-content:space-between}.form-in-3-cols button.shadowed,.form-in-3-cols .button.shadowed{width:100%;color:#1b4991;text-transform:uppercase;display:flex;flex-direction:column;justify-content:center;text-align:center}.form-in-3-cols button.shadowed:before,.form-in-3-cols .button.shadowed:before{content:"+";display:block;margin-bottom:.75rem;font-size:3rem}.form-in-3-cols .fr-grid-row+.fr-grid-row{margin-top:2rem}@media(max-width: 48em){.form-grid-row .fr-col-md-5{padding-bottom:.25rem}.form-grid-row .fr-col-md-7,.form-grid-row .zipcode-container,.form-grid-row .city-container{padding-top:0}}@media(min-width: 62em){.form-grid-row-narrow .fr-col-md-5{padding-bottom:.25rem}.form-grid-row-narrow .fr-col-md-7,.form-grid-row-narrow .zipcode-container,.form-grid-row-narrow .city-container{padding-top:0}.form-grid-row-narrow button{width:100%}}.habilitation-breadcrumbs{list-style:none;display:flex;justify-content:space-around;border-bottom:1px solid #ef4056;padding:0;margin:4rem 0}.habilitation-breadcrumbs>li{margin:0;padding:0 0 2rem;text-align:center;position:relative;transform:translateY(0.5rem)}.habilitation-breadcrumbs>li a{text-decoration:none;color:#333;font-weight:normal}.habilitation-breadcrumbs>li a:hover{box-shadow:0 .5rem 0 #fad776;color:#ef4056}.habilitation-breadcrumbs>li:after{content:"";background:#fff;border:1px solid #ef4056;width:1rem;height:1rem;border-radius:100%;display:block;position:absolute;bottom:0;left:50%;margin-left:-0.5rem}.habilitation-breadcrumbs>li.active{font-weight:bold;color:#ef4056}.habilitation-breadcrumbs>li.active:after{background:#ef4056}.habilitation-breadcrumbs>li:first-child:before,.habilitation-breadcrumbs>li:last-child:before{content:"";position:absolute;background:#fff;width:10rem;height:1rem;right:50%;bottom:0}.habilitation-breadcrumbs>li:last-child:before{left:50%}.skip-links{background:#f2f2f2;border-bottom:1px solid #1b4991;transition:transform .3s;padding:.5rem 1rem;font-size:1rem;position:absolute;transform:translateY(-100%)}.skip-links:focus-within{transform:translateY(0);position:relative}.skip-links a{color:#1b4991;margin-right:1em}.header-logo{display:flex;align-items:center}.header-logo:focus-visible{background:#fff}.header-links{list-style:none;text-align:right}.header-links li{display:inline-block;margin-left:2rem}.header-links a{text-decoration:none;color:#333;display:block;padding:.25rem 0}.header-links a.active{color:#ef4056;font-weight:bold}.header-links a:hover{box-shadow:0 .5rem 0 #fad776}footer{background:#333;color:#fff;padding:3rem 0;margin:5rem 0 0}.footer-links{list-style:none}.footer-links li{margin-bottom:.5rem}.footer-links li.text-l{margin-bottom:1rem}.footer-links a{color:#fff}.footer-social{list-style:none;margin:1rem 0 0}.footer-social li{display:inline-block;padding:0 1rem 0 0}.footer-social a{color:#fff;text-decoration:none}.footer-social .icon{fill:#fff;width:1.5rem;height:1.5rem;vertical-align:-25%}.footer-social a:focus-visible .icon{fill:#333}/*# sourceMappingURL=main-habilitation.css.map */ +html,body{height:100%}ul,ol{margin:0;padding:0}svg.previews{display:none}#main{overflow:hidden}main a[href]{color:#ef4056;font-weight:bold}:focus-visible{background:#fad776;color:#333 !important;outline:2px solid #fad776;border-radius:2px}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.text-l{font-size:1.5rem}.shadowed{border:1px solid #fad776;box-sizing:border-box;box-shadow:10px 10px 0 #fad776;padding:2rem}.shadowed.grey{box-shadow:10px 10px 0 #c5c5c5;border-color:#c5c5c5}h1,.h1{font-size:3rem;font-weight:bold;color:#ef4056;margin:2.5rem 0;text-transform:uppercase;line-height:1.25}h1+.subtitle,.h1+.subtitle{font-size:1.5rem;color:#5770be}h2,.h2{font-size:2.25rem;color:#1b4991;font-weight:bold;text-transform:uppercase;margin:2rem 0;line-height:1.25}h2+.subtitle,.h2+.subtitle{margin-top:-1.5rem;margin-bottom:2rem}h2:first-child,legend+h2,.h2:first-child,legend+.h2{margin-top:0}h3,.h3{font-size:1.5rem;color:#5770be;font-weight:normal;margin:2.5rem 0 1.5rem;line-height:1.25}h3:first-child,legend+h3,.h3:first-child,legend+.h3{margin-top:0}.shadowed .h2,.shadowed .h3{font-size:1.125rem}.more-info{font-style:italic;color:#5770be;margin-top:4rem}details{border:1px solid #1b4991}details summary{background:#1b4991 no-repeat url("../img/plus-w.svg") 98% 50%;color:#fff;cursor:pointer;padding:1rem 3rem 1rem 1rem}details summary::marker{content:""}details summary:before{background:#fad776;border-radius:100%;color:#1b4991;content:"!";display:inline-block;font-size:1.7rem;font-weight:bold;height:2rem;margin-right:1rem;text-align:center;width:2rem}details[open] summary{background-image:url("../img/x.svg")}details .details-content{padding:0 1rem}input[type=text],input[type=number],input[type=email],input[type=tel],input[type=url]{border:1px solid #5770be;font-family:"Marianne",arial,sans-serif;font-size:1rem;line-height:2.25;padding:0 .5rem;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}input[type=text]:focus,input[type=number]:focus,input[type=email]:focus,input[type=tel]:focus,input[type=url]:focus{border-color:#fad776;background:#fad776}select{border:1px solid #5770be;border-radius:0;font-family:"Marianne",arial,sans-serif;font-size:1rem;padding:0 .5rem;background:#fff url(../img/dropdown.svg) no-repeat 98% 56%;max-width:100%;height:2.25rem;-webkit-appearance:none;appearance:none}select:focus{border-color:#fad776;background-color:#fad776}textarea{border:1px solid #5770be;background:#fff;width:100%;resize:vertical;font-family:"Marianne",arial,sans-serif;padding:.5rem;line-height:1.25}textarea:focus{border-color:#fad776;background:#fad776}input[type=checkbox],input[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;height:1.5rem;width:1.5rem;min-width:1.5rem;padding:0;margin:0 1rem 0 0;position:relative;border:1px solid #5770be;vertical-align:middle}input[type=checkbox]:before,input[type=radio]:before{transform:scale(0);content:"";position:absolute;top:0;left:0;bottom:0;right:0;background:url("../img/x.svg") 50% no-repeat}input[type=checkbox]:checked:before,input[type=radio]:checked:before{transform:scale(1)}input[type=radio]{border-radius:100%}input[type=radio]:checked:before{background:#333;border-radius:100%;border:4px solid #fff}button,.button{background:#fff;border:1px solid #ef4056;color:#ef4056;cursor:pointer;display:inline-block;font-family:"Marianne",arial,sans-serif;font-size:1rem;font-weight:bold;line-height:1.3;margin:0;padding:.75rem;text-decoration:none;vertical-align:baseline}button.primary,.button.primary{background:#ef4056;color:#fff}button:focus-visible,.button:focus-visible{background:#fad776;color:#333}fieldset{border:none;padding:0;margin:0}.form-grid-row label:only-child,.form-grid-row input{width:100%}.form-grid-row input[type=checkbox],.form-grid-row input[type=radio]{width:1.5rem}.checkbox-col{display:flex;align-items:center}.fr-col-md-2.zipcode-container{padding-right:0}.form-grid-row.form-grid-row-error input{border-color:#ef4056}.fr-grid-row--gutters .errors{padding-top:.25rem;padding-bottom:1.5rem;font-size:.75rem;line-height:1.25;color:#e9133e}.fr-grid-row--gutters .errors>p{margin:0}.help-text{margin-top:0;font-size:.9rem;color:#666}.button-box{display:flex;justify-content:space-between}.button-box>:only-child{margin-left:auto}.button-box.standalone{margin-top:4rem}.shadowed .button-box{transform:translateY(4rem)}.form-in-3-cols .shadowed .button-box{transform:translateY(3rem)}.grey-background{background:#f2f2f2;padding:1rem;margin:1rem 0}.grey-background.shown-on-checkbox{position:relative}.grey-background.shown-on-checkbox::before{position:absolute;content:"";width:1.5rem;height:1.5rem;background:#f2f2f2;transform:rotate(45deg);left:.2rem;top:-0.6rem;border-radius:0 0 100% 0}.form-in-3-cols .shadowed{padding:1rem;height:100%}.form-in-3-cols .shadowed.with-button-box{display:flex;flex-direction:column;justify-content:space-between}.form-in-3-cols button.shadowed,.form-in-3-cols .button.shadowed{width:100%;color:#1b4991;text-transform:uppercase;display:flex;flex-direction:column;justify-content:center;text-align:center}.form-in-3-cols button.shadowed:before,.form-in-3-cols .button.shadowed:before{content:"+";display:block;margin-bottom:.75rem;font-size:3rem}.form-in-3-cols .fr-grid-row+.fr-grid-row{margin-top:2rem}@media(max-width: 48em){.form-grid-row .fr-col-md-5{padding-bottom:.25rem}.form-grid-row .fr-col-md-7,.form-grid-row .zipcode-container,.form-grid-row .city-container{padding-top:0}}@media(min-width: 62em){.form-grid-row-narrow .fr-col-md-5{padding-bottom:.25rem}.form-grid-row-narrow .fr-col-md-7,.form-grid-row-narrow .zipcode-container,.form-grid-row-narrow .city-container{padding-top:0}.form-grid-row-narrow button{width:100%}}.habilitation-breadcrumbs{list-style:none;display:flex;justify-content:space-around;border-bottom:1px solid #ef4056;padding:0;margin:4rem 0}.habilitation-breadcrumbs>li{margin:0;padding:0 0 2rem;text-align:center;position:relative;transform:translateY(0.5rem)}.habilitation-breadcrumbs>li a{text-decoration:none;color:#333;font-weight:normal}.habilitation-breadcrumbs>li a:hover{box-shadow:0 .5rem 0 #fad776;color:#ef4056}.habilitation-breadcrumbs>li:after{content:"";background:#fff;border:1px solid #ef4056;width:1rem;height:1rem;border-radius:100%;display:block;position:absolute;bottom:0;left:50%;margin-left:-0.5rem}.habilitation-breadcrumbs>li.active{font-weight:bold;color:#ef4056}.habilitation-breadcrumbs>li.active:after{background:#ef4056}.habilitation-breadcrumbs>li:first-child:before,.habilitation-breadcrumbs>li:last-child:before{content:"";position:absolute;background:#fff;width:10rem;height:1rem;right:50%;bottom:0}.habilitation-breadcrumbs>li:last-child:before{left:50%}.skip-links{background:#f2f2f2;border-bottom:1px solid #1b4991;transition:transform .3s;padding:.5rem 1rem;font-size:1rem;position:absolute;transform:translateY(-100%)}.skip-links:focus-within{transform:translateY(0);position:relative}.skip-links a{color:#1b4991;margin-right:1em}.header-logo{display:flex;align-items:center}.header-logo:focus-visible{background:#fff}.header-links{list-style:none;text-align:right}.header-links li{display:inline-block;margin-left:2rem}.header-links a{text-decoration:none;color:#333;display:block;padding:.25rem 0}.header-links a.active{color:#ef4056;font-weight:bold}.header-links a:hover{box-shadow:0 .5rem 0 #fad776}footer{background:#333;color:#fff;padding:3rem 0;margin:5rem 0 0}.footer-links{list-style:none}.footer-links li{margin-bottom:.5rem}.footer-links li.text-l{margin-bottom:1rem}.footer-links a{color:#fff}.footer-social{list-style:none;margin:1rem 0 0}.footer-social li{display:inline-block;padding:0 1rem 0 0}.footer-social a{color:#fff;text-decoration:none}.footer-social .icon{fill:#fff;width:1.5rem;height:1.5rem;vertical-align:-25%}.footer-social a:focus-visible .icon{fill:#333}/*# sourceMappingURL=main-habilitation.css.map */ diff --git a/aidants_connect_habilitation/static/css/main-habilitation.css.map b/aidants_connect_habilitation/static/css/main-habilitation.css.map index fb7494365..f4c72f244 100644 --- a/aidants_connect_habilitation/static/css/main-habilitation.css.map +++ b/aidants_connect_habilitation/static/css/main-habilitation.css.map @@ -1 +1 @@ -{"version":3,"sourceRoot":"","sources":["../scss/main-habilitation.scss"],"names":[],"mappings":"AAuBA,UACE,YAGF,MACE,SACA,UAGF,aACE,aAGF,MACE,gBAIA,aACE,MAlCU,QAmCV,iBAMJ,eACE,WA7CmB,QA8CnB,sBACA,0BACA,kBAKF,SACE,oBACA,yCACA,wCACA,gCACA,sBACA,uBACA,2BACA,qBACA,6BACA,qBACA,8BAMF,QACE,iBAGF,UACE,yBACA,sBACA,+BACA,aAEA,eACE,+BACA,qBAIJ,OACE,eACA,iBACA,MAtFY,QAuFZ,gBACA,yBACA,iBAEA,2BACE,iBACA,MAjGc,QAqGlB,OACE,kBACA,MAxGa,QAyGb,iBACA,yBACA,cACA,iBAEA,2BACE,mBACA,mBAGF,oDACE,aAIJ,OACE,iBACA,MAzHgB,QA0HhB,mBACA,uBACA,iBAEA,oDACE,aAKF,4BACE,mBAIJ,WACE,kBACA,MA3IgB,QA4IhB,gBAIF,QACE,yBAEA,gBACE,8DACA,WACA,eACA,4BAEA,wBACE,WAGF,uBACE,WA7Je,QA8Jf,mBACA,MAjKS,QAkKT,YACA,qBACA,iBACA,iBACA,YACA,kBACA,kBACA,WAIJ,sBACE,qCAGF,yBACE,eAMJ,sFACE,yBACA,YAlLW,4BAmLX,eACA,iBACA,gBACA,6BACA,0BACA,qBAEA,oHACE,aAjMiB,QAkMjB,WAlMiB,QAsMrB,OACE,yBACA,gBACA,YAnMW,4BAoMX,eACA,gBACA,2DACA,eACA,eACA,wBACA,gBAEA,aACE,aAnNiB,QAoNjB,iBApNiB,QAwNrB,SACE,yBACA,gBACA,WACA,gBACA,YAvNW,4BAwNX,cACA,iBAEA,eACE,aAlOiB,QAmOjB,WAnOiB,QAuOrB,uCACE,wBACA,qBACA,gBACA,cACA,aACA,iBACA,UACA,kBACA,kBACA,yBACA,sBAEA,qDACE,mBACA,WACA,kBACA,MACA,OACA,SACA,QACA,6CAIA,qEACE,mBAKN,kBACE,mBAGE,iCACE,WAhRc,KAiRd,mBACA,sBAKN,eACE,gBACA,yBACA,MAlRY,QAmRZ,eACA,qBACA,YAlRW,4BAmRX,eACA,iBACA,gBACA,SACA,eACA,qBACA,wBAEA,+BACE,WA/RU,QAgSV,WAGF,2CACE,WAvSiB,QAwSjB,MA7SgB,KAiTpB,SACE,YACA,UACA,SAIA,qDACE,WAGF,qEACE,aAIJ,cACE,aACA,mBAGF,+BACE,gBAIA,yCACE,aApUU,QAwUd,8BACE,mBACA,sBACA,iBACA,iBACA,MA5U2B,QA8U3B,gCACE,SAIJ,WACE,aACA,gBACA,WAGF,YACE,aACA,8BAEA,wBACE,iBAGF,uBACE,gBAIJ,sBACE,2BAGF,sCACE,2BAGF,wBACE,mBACA,aACA,cAIA,0BACE,aACA,YAEA,0CACE,aACA,sBACA,8BAIJ,iEACE,WACA,MAxYW,QAyYX,yBACA,aACA,sBACA,uBACA,kBAEA,+EACE,YACA,cACA,qBACA,eAIJ,0CACE,gBAIJ,wBAEI,4BACE,sBAGF,6FACE,eAKN,wBAEI,mCACE,sBAGF,kHACE,cAGF,6BACE,YAQN,0BACE,gBACA,aACA,6BACA,gCACA,UACA,cAEA,6BACE,SACA,iBACA,kBACA,kBACA,6BAEA,+BACE,qBACA,MA/cc,KAgdd,mBAEA,qCACE,6BACA,MA5cM,QAgdV,mCACE,WACA,gBACA,yBACA,WACA,YACA,mBACA,cACA,kBACA,SACA,SACA,oBAGF,oCACE,iBACA,MAheQ,QAkeR,0CACE,WAneM,QAweR,+FACE,WACA,kBACA,gBACA,YACA,YACA,UACA,SAKF,+CACE,SAQR,YACE,WArgBmB,QAsgBnB,gCACA,yBACA,mBACA,eACA,kBACA,4BAGF,yBACE,wBACA,kBAGF,cACE,MAlhBa,QAmhBb,iBAGF,aACE,aACA,mBAEA,2BACE,WA5hBY,KAgiBhB,cACE,gBACA,iBAEA,iBACE,qBACA,iBAGF,gBACE,qBACA,MA7iBgB,KA8iBhB,cACA,iBAEA,uBACE,MA1iBQ,QA2iBR,iBAGF,sBACE,6BAON,OACE,WA/jBkB,KAgkBlB,MA9jBc,KA+jBd,eACA,gBAGF,cACE,gBAEA,iBACE,oBAEA,wBACE,mBAIJ,gBACE,MA/kBY,KAmlBhB,eACE,gBACA,gBAEA,kBACE,qBACA,mBAGF,iBACE,MA7lBY,KA8lBZ,qBAGF,qBACE,KAlmBY,KAmmBZ,aACA,cACA,oBAGF,qCACE,KA3mBgB","file":"main-habilitation.css"} +{"version":3,"sourceRoot":"","sources":["../scss/main-habilitation.scss"],"names":[],"mappings":"AAuBA,UACE,YAGF,MACE,SACA,UAGF,aACE,aAGF,MACE,gBAIA,aACE,MAlCU,QAmCV,iBAMJ,eACE,WA7CmB,QA8CnB,sBACA,0BACA,kBAKF,SACE,oBACA,yCACA,wCACA,gCACA,sBACA,uBACA,2BACA,qBACA,6BACA,qBACA,8BAMF,QACE,iBAGF,UACE,yBACA,sBACA,+BACA,aAEA,eACE,+BACA,qBAIJ,OACE,eACA,iBACA,MAtFY,QAuFZ,gBACA,yBACA,iBAEA,2BACE,iBACA,MAjGc,QAqGlB,OACE,kBACA,MAxGa,QAyGb,iBACA,yBACA,cACA,iBAEA,2BACE,mBACA,mBAGF,oDACE,aAIJ,OACE,iBACA,MAzHgB,QA0HhB,mBACA,uBACA,iBAEA,oDACE,aAKF,4BACE,mBAIJ,WACE,kBACA,MA3IgB,QA4IhB,gBAIF,QACE,yBAEA,gBACE,8DACA,WACA,eACA,4BAEA,wBACE,WAGF,uBACE,WA7Je,QA8Jf,mBACA,MAjKS,QAkKT,YACA,qBACA,iBACA,iBACA,YACA,kBACA,kBACA,WAIJ,sBACE,qCAGF,yBACE,eAMJ,sFACE,yBACA,YAlLW,4BAmLX,eACA,iBACA,gBACA,6BACA,0BACA,qBAEA,oHACE,aAjMiB,QAkMjB,WAlMiB,QAsMrB,OACE,yBACA,gBACA,YAnMW,4BAoMX,eACA,gBACA,2DACA,eACA,eACA,wBACA,gBAEA,aACE,aAnNiB,QAoNjB,iBApNiB,QAwNrB,SACE,yBACA,gBACA,WACA,gBACA,YAvNW,4BAwNX,cACA,iBAEA,eACE,aAlOiB,QAmOjB,WAnOiB,QAuOrB,uCACE,wBACA,qBACA,gBACA,cACA,aACA,iBACA,UACA,kBACA,kBACA,yBACA,sBAEA,qDACE,mBACA,WACA,kBACA,MACA,OACA,SACA,QACA,6CAIA,qEACE,mBAKN,kBACE,mBAGE,iCACE,WAhRc,KAiRd,mBACA,sBAKN,eACE,gBACA,yBACA,MAlRY,QAmRZ,eACA,qBACA,YAlRW,4BAmRX,eACA,iBACA,gBACA,SACA,eACA,qBACA,wBAEA,+BACE,WA/RU,QAgSV,WAGF,2CACE,WAvSiB,QAwSjB,MA7SgB,KAiTpB,SACE,YACA,UACA,SAIA,qDACE,WAGF,qEACE,aAIJ,cACE,aACA,mBAGF,+BACE,gBAIA,yCACE,aApUU,QAwUd,8BACE,mBACA,sBACA,iBACA,iBACA,MA5U2B,QA8U3B,gCACE,SAIJ,WACE,aACA,gBACA,WAGF,YACE,aACA,8BAEA,wBACE,iBAGF,uBACE,gBAIJ,sBACE,2BAGF,sCACE,2BAGF,iBACE,mBACA,aACA,cAEA,mCACE,kBAEA,2CACE,kBACA,WACA,aACA,cACA,mBACA,wBACA,WACA,YACA,yBAMJ,0BACE,aACA,YAEA,0CACE,aACA,sBACA,8BAIJ,iEACE,WACA,MAxZW,QAyZX,yBACA,aACA,sBACA,uBACA,kBAEA,+EACE,YACA,cACA,qBACA,eAIJ,0CACE,gBAIJ,wBAEI,4BACE,sBAGF,6FACE,eAKN,wBAEI,mCACE,sBAGF,kHACE,cAGF,6BACE,YAQN,0BACE,gBACA,aACA,6BACA,gCACA,UACA,cAEA,6BACE,SACA,iBACA,kBACA,kBACA,6BAEA,+BACE,qBACA,MA/dc,KAged,mBAEA,qCACE,6BACA,MA5dM,QAgeV,mCACE,WACA,gBACA,yBACA,WACA,YACA,mBACA,cACA,kBACA,SACA,SACA,oBAGF,oCACE,iBACA,MAhfQ,QAkfR,0CACE,WAnfM,QAwfR,+FACE,WACA,kBACA,gBACA,YACA,YACA,UACA,SAKF,+CACE,SAQR,YACE,WArhBmB,QAshBnB,gCACA,yBACA,mBACA,eACA,kBACA,4BAGF,yBACE,wBACA,kBAGF,cACE,MAliBa,QAmiBb,iBAGF,aACE,aACA,mBAEA,2BACE,WA5iBY,KAgjBhB,cACE,gBACA,iBAEA,iBACE,qBACA,iBAGF,gBACE,qBACA,MA7jBgB,KA8jBhB,cACA,iBAEA,uBACE,MA1jBQ,QA2jBR,iBAGF,sBACE,6BAON,OACE,WA/kBkB,KAglBlB,MA9kBc,KA+kBd,eACA,gBAGF,cACE,gBAEA,iBACE,oBAEA,wBACE,mBAIJ,gBACE,MA/lBY,KAmmBhB,eACE,gBACA,gBAEA,kBACE,qBACA,mBAGF,iBACE,MA7mBY,KA8mBZ,qBAGF,qBACE,KAlnBY,KAmnBZ,aACA,cACA,oBAGF,qCACE,KA3nBgB","file":"main-habilitation.css"} From f1cf033254768bca845ebbde29dab2bbb2f75aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Mon, 21 Mar 2022 09:00:25 +0100 Subject: [PATCH 06/17] Add tests for france_services and is_private_org --- .../tests/test_functionnal/test_organisation_form.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py index 62218c7ab..5d7be3a87 100644 --- a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py +++ b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py @@ -32,6 +32,7 @@ def test_form_normal_organisation(self): Select(self.selenium.find_element(By.ID, "id_type")).select_by_value( str(request.type.id) ) + self.selenium.find_element(By.ID, "id_france_services_label").click() for field in [ "name", @@ -39,8 +40,7 @@ def test_form_normal_organisation(self): "address", "zipcode", "city", - "partner_administration", - "france_services_label", + "france_services_number", # only if france_service_label=True "web_site", "mission_description", "avg_nb_demarches", @@ -77,6 +77,7 @@ def test_form_other_organisation(self): ) self.selenium.find_element(By.ID, "id_type_other").send_keys(request.type_other) + self.selenium.find_element(By.ID, "id_is_private_org").click() for field in [ "name", @@ -84,8 +85,7 @@ def test_form_other_organisation(self): "address", "zipcode", "city", - "partner_administration", - "france_services_label", + "partner_administration", # only if is_private_org=True "web_site", "mission_description", "avg_nb_demarches", From 9342d699f485a0c150e326844409db61e22f2625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Thu, 24 Mar 2022 17:09:58 +0100 Subject: [PATCH 07/17] Add constraint on is_private_org and france_services_label --- .../migrations/0014_auto_20220324_1654.py | 21 +++++++++++++++ aidants_connect_habilitation/models.py | 26 +++++++++++++++++++ .../tests/factories.py | 4 +-- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py diff --git a/aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py b/aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py new file mode 100644 index 000000000..6096ee6fd --- /dev/null +++ b/aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.12 on 2022-03-24 15:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('aidants_connect_habilitation', '0013_auto_20220318_1704'), + ] + + operations = [ + migrations.AddConstraint( + model_name='organisationrequest', + constraint=models.CheckConstraint(check=models.Q(models.Q(('is_private_org', True), ('partner_administration__isnull_or_blank', False)), models.Q(('is_private_org', False), ('partner_administration__isnull_or_blank', True)), _connector='OR'), name='partner_administration_if_org_is_private'), + ), + migrations.AddConstraint( + model_name='organisationrequest', + constraint=models.CheckConstraint(check=models.Q(models.Q(('france_services_label', True), ('france_services_number__isnull_or_blank', False)), models.Q(('france_services_label', False), ('france_services_number__isnull_or_blank', True)), _connector='OR'), name='immatriculation_number_if_france_services_label'), + ), + ] diff --git a/aidants_connect_habilitation/models.py b/aidants_connect_habilitation/models.py index 08c3f3e31..982b3192c 100644 --- a/aidants_connect_habilitation/models.py +++ b/aidants_connect_habilitation/models.py @@ -295,6 +295,32 @@ class Meta: ), name="type_other_correctly_set", ), + models.CheckConstraint( + check=( + ( + Q(is_private_org=True) + & Q(partner_administration__isnull_or_blank=False) + ) + | ( + Q(is_private_org=False) + & Q(partner_administration__isnull_or_blank=True) + ) + ), + name="partner_administration_if_org_is_private", + ), + models.CheckConstraint( + check=( + ( + Q(france_services_label=True) + & Q(france_services_number__isnull_or_blank=False) + ) + | ( + Q(france_services_label=False) + & Q(france_services_number__isnull_or_blank=True) + ) + ), + name="immatriculation_number_if_france_services_label", + ), models.CheckConstraint( check=Q(status=RequestStatusConstants.NEW.name) | (~Q(status=RequestStatusConstants.NEW.name) & Q(cgu=True)), diff --git a/aidants_connect_habilitation/tests/factories.py b/aidants_connect_habilitation/tests/factories.py index 5f71df8d1..14e866ab8 100644 --- a/aidants_connect_habilitation/tests/factories.py +++ b/aidants_connect_habilitation/tests/factories.py @@ -103,11 +103,9 @@ class OrganisationRequestFactory(DjangoModelFactory): zipcode = FactoryFaker("postcode") city = FactoryFaker("city") - partner_administration = FactoryFaker("company") - public_service_delegation_attestation = "" - france_services_label = FuzzyChoice([True, False]) + france_services_label = False web_site = FactoryFaker("url") From 38a21a21642173738e794d179cf4f3d2f791f378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Thu, 24 Mar 2022 17:10:29 +0100 Subject: [PATCH 08/17] Remove noisy print() in tests --- aidants_connect_habilitation/tests/test_views.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/aidants_connect_habilitation/tests/test_views.py b/aidants_connect_habilitation/tests/test_views.py index 9775e7ab1..61e9c7fca 100644 --- a/aidants_connect_habilitation/tests/test_views.py +++ b/aidants_connect_habilitation/tests/test_views.py @@ -308,7 +308,6 @@ def test_404_on_bad_issuer_id(self): def test_new_organisation_request_is_displayed_with_links(self): organisation = DraftOrganisationRequestFactory(issuer=self.issuer) response = self.client.get(self.get_url(self.issuer.issuer_id)) - print(response.content) self.assertContains(response, RequestStatusConstants.NEW.value) self.assertContains(response, "Soumettre la demande") self.assertContains(response, organisation.name) @@ -319,7 +318,6 @@ def test_submitted_organisation_request_is_displayed_without_links(self): status=RequestStatusConstants.AC_VALIDATION_PROCESSING.name, ) response = self.client.get(self.get_url(self.issuer.issuer_id)) - print(response.content) self.assertNotContains(response, RequestStatusConstants.NEW.value) self.assertContains( response, RequestStatusConstants.AC_VALIDATION_PROCESSING.value From 8b713d10335e43bb6395389356cf1837d034a7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Thu, 24 Mar 2022 17:18:02 +0100 Subject: [PATCH 09/17] Add migrations after rebase --- .../migrations/0013_auto_20220318_1704.py | 23 ------------------- ...324_1654.py => 0014_auto_20220324_1713.py} | 14 +++++++++-- 2 files changed, 12 insertions(+), 25 deletions(-) delete mode 100644 aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py rename aidants_connect_habilitation/migrations/{0014_auto_20220324_1654.py => 0014_auto_20220324_1713.py} (61%) diff --git a/aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py b/aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py deleted file mode 100644 index 7064ab3bf..000000000 --- a/aidants_connect_habilitation/migrations/0013_auto_20220318_1704.py +++ /dev/null @@ -1,23 +0,0 @@ -# Generated by Django 3.2.12 on 2022-03-18 16:04 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('aidants_connect_habilitation', '0012_auto_20220314_1530'), - ] - - operations = [ - migrations.AddField( - model_name='organisationrequest', - name='france_services_number', - field=models.CharField(blank=True, default='', max_length=200, verbose_name='Numéro d’immatriculation France Services'), - ), - migrations.AddField( - model_name='organisationrequest', - name='is_private_org', - field=models.BooleanField(default=False, verbose_name='Structure privée'), - ), - ] diff --git a/aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py b/aidants_connect_habilitation/migrations/0014_auto_20220324_1713.py similarity index 61% rename from aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py rename to aidants_connect_habilitation/migrations/0014_auto_20220324_1713.py index 6096ee6fd..b336b567e 100644 --- a/aidants_connect_habilitation/migrations/0014_auto_20220324_1654.py +++ b/aidants_connect_habilitation/migrations/0014_auto_20220324_1713.py @@ -1,4 +1,4 @@ -# Generated by Django 3.2.12 on 2022-03-24 15:54 +# Generated by Django 3.2.12 on 2022-03-24 16:13 from django.db import migrations, models @@ -6,10 +6,20 @@ class Migration(migrations.Migration): dependencies = [ - ('aidants_connect_habilitation', '0013_auto_20220318_1704'), + ('aidants_connect_habilitation', '0013_auto_20220321_0941'), ] operations = [ + migrations.AddField( + model_name='organisationrequest', + name='france_services_number', + field=models.CharField(blank=True, default='', max_length=200, verbose_name='Numéro d’immatriculation France Services'), + ), + migrations.AddField( + model_name='organisationrequest', + name='is_private_org', + field=models.BooleanField(default=False, verbose_name='Structure privée'), + ), migrations.AddConstraint( model_name='organisationrequest', constraint=models.CheckConstraint(check=models.Q(models.Q(('is_private_org', True), ('partner_administration__isnull_or_blank', False)), models.Q(('is_private_org', False), ('partner_administration__isnull_or_blank', True)), _connector='OR'), name='partner_administration_if_org_is_private'), From 8a84446c28c132bcff2b0c34196764f74ee7987a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Thu, 24 Mar 2022 17:41:21 +0100 Subject: [PATCH 10/17] Fix tests broken with new constraints --- .../tests/test_functionnal/test_organisation_form.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py index 5d7be3a87..5b73650a5 100644 --- a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py +++ b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py @@ -185,8 +185,6 @@ def test_submit_both_known_organisation_type_and_other_type(self): "address", "zipcode", "city", - "partner_administration", - "france_services_label", "web_site", "mission_description", "avg_nb_demarches", From 17e189b531453e0e95963c7cb38350d336ea5577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 25 Mar 2022 16:29:12 +0100 Subject: [PATCH 11/17] Clean partner_administration on server side if needed needed = is_private_org is True --- aidants_connect_habilitation/forms.py | 10 +++++++ .../tests/test_forms.py | 28 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index ee946661c..9071b5e76 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -164,6 +164,16 @@ def clean_type_other(self): return self.data["type_other"] + def clean_partner_administration(self): + if not self.data["is_private_org"]: + return "" + + if not self.data["partner_administration"]: + raise ValidationError( + "Vous avez indiqué que la structure est privée : merci de renseigner " + "votre administration partenaire." + ) + class Meta: model = models.OrganisationRequest fields = [ diff --git a/aidants_connect_habilitation/tests/test_forms.py b/aidants_connect_habilitation/tests/test_forms.py index abbedf5b5..8f75f871b 100644 --- a/aidants_connect_habilitation/tests/test_forms.py +++ b/aidants_connect_habilitation/tests/test_forms.py @@ -68,6 +68,34 @@ def test_clean_type_other_unspecified_raises_error(self): ], ) + def test_private_org_requires_partner_administration(self): + form = get_form( + OrganisationRequestForm, + ignore_errors=True, + is_private_org=True, + partner_administration="", + ) + self.assertFalse(form.is_valid()) + self.assertIn("merci de renseigner", form.errors["partner_administration"][0]) + + def test_private_org_keeps_partner_administration(self): + form = get_form( + OrganisationRequestForm, + is_private_org=True, + partner_administration="Beta.Gouv", + ) + self.assertTrue(form.is_valid()) + self.assertEqual("Beta.Gouv", form.cleaned_data["partner_administration"]) + + def test_non_private_org_clears_partner_administration(self): + form = get_form( + OrganisationRequestForm, + is_private_org=False, + partner_administration="Beta.Gouv", + ) + self.assertTrue(form.is_valid()) + self.assertEqual("", form.cleaned_data["partner_administration"]) + class TestPersonnelForm(TestCase): @patch("aidants_connect_habilitation.forms.ManagerForm.is_valid") From faf5b1c82dc15bcffdce492eaba1576551c7544c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 25 Mar 2022 16:47:46 +0100 Subject: [PATCH 12/17] Clear france_services_number if necessary --- aidants_connect_habilitation/forms.py | 14 +++++++++ .../tests/test_forms.py | 30 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 9071b5e76..683a92175 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -174,6 +174,20 @@ def clean_partner_administration(self): "votre administration partenaire." ) + return self.data["partner_administration"] + + def clean_france_services_number(self): + if not self.data["france_services_label"]: + return + + if not self.data["france_services_number"]: + raise ValidationError( + "Vous avez indiqué que la structure est labellisée France Services : " + "merci de renseigner son numéro d’immatriculation France Services." + ) + + return self.data["france_services_number"] + class Meta: model = models.OrganisationRequest fields = [ diff --git a/aidants_connect_habilitation/tests/test_forms.py b/aidants_connect_habilitation/tests/test_forms.py index 8f75f871b..7ad6b5064 100644 --- a/aidants_connect_habilitation/tests/test_forms.py +++ b/aidants_connect_habilitation/tests/test_forms.py @@ -96,6 +96,36 @@ def test_non_private_org_clears_partner_administration(self): self.assertTrue(form.is_valid()) self.assertEqual("", form.cleaned_data["partner_administration"]) + def test_france_services_label_requires_fs_number(self): + form = get_form( + OrganisationRequestForm, + france_services_label=True, + france_services_number=None, + ignore_errors=True, + ) + self.assertFalse(form.is_valid()) + self.assertIn( + "merci de renseigner son numéro", form.errors["france_services_number"][0] + ) + + def test_france_services_label_keeps_fs_number(self): + form = get_form( + OrganisationRequestForm, + france_services_label=True, + france_services_number=444666999, + ) + self.assertTrue(form.is_valid()) + self.assertEqual(form.cleaned_data["france_services_number"], 444666999) + + def test_no_france_services_label_clears_fs_number(self): + form = get_form( + OrganisationRequestForm, + france_services_label=False, + france_services_number=444666999, + ) + self.assertTrue(form.is_valid()) + self.assertIsNone(form.cleaned_data["france_services_number"]) + class TestPersonnelForm(TestCase): @patch("aidants_connect_habilitation.forms.ManagerForm.is_valid") From 0550fef72ca50614d15f309b40dd94514d5e3050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 25 Mar 2022 17:28:51 +0100 Subject: [PATCH 13/17] Avoid errors in tests due to "None" in forms --- aidants_connect_habilitation/forms.py | 2 +- aidants_connect_habilitation/tests/test_forms.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 683a92175..09b29510b 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -178,7 +178,7 @@ def clean_partner_administration(self): def clean_france_services_number(self): if not self.data["france_services_label"]: - return + return "" if not self.data["france_services_number"]: raise ValidationError( diff --git a/aidants_connect_habilitation/tests/test_forms.py b/aidants_connect_habilitation/tests/test_forms.py index 7ad6b5064..582932dff 100644 --- a/aidants_connect_habilitation/tests/test_forms.py +++ b/aidants_connect_habilitation/tests/test_forms.py @@ -124,7 +124,7 @@ def test_no_france_services_label_clears_fs_number(self): france_services_number=444666999, ) self.assertTrue(form.is_valid()) - self.assertIsNone(form.cleaned_data["france_services_number"]) + self.assertEqual("", form.cleaned_data["france_services_number"]) class TestPersonnelForm(TestCase): From 47c8de7e0319b55cd3004367f8031a064f247da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 25 Mar 2022 17:46:36 +0100 Subject: [PATCH 14/17] Avoid 500 due to MultiValueDictKeyError when checkbox is not checked --- aidants_connect_habilitation/forms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 09b29510b..1404c0e47 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -165,7 +165,7 @@ def clean_type_other(self): return self.data["type_other"] def clean_partner_administration(self): - if not self.data["is_private_org"]: + if not self.data.get("is_private_org", False): return "" if not self.data["partner_administration"]: @@ -177,7 +177,7 @@ def clean_partner_administration(self): return self.data["partner_administration"] def clean_france_services_number(self): - if not self.data["france_services_label"]: + if not self.data.get("france_services_label", False): return "" if not self.data["france_services_number"]: From fba13015dda094054c145a820efd8df05576fcc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 25 Mar 2022 17:47:11 +0100 Subject: [PATCH 15/17] Adjust tests so they pass with new constraints --- .../tests/test_functionnal/test_organisation_form.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py index 5b73650a5..b4c1bce54 100644 --- a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py +++ b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py @@ -21,11 +21,12 @@ @tag("functional") class OrganisationRequestFormViewTests(FunctionalTestCase): - def test_form_normal_organisation(self): + def test_form_normal_organisation_with_fs_label(self): issuer: Issuer = IssuerFactory() request: OrganisationRequest = OrganisationRequestFactory.build( type_id=RequestOriginConstants.MEDIATHEQUE.value, public_service_delegation_attestation=False, + france_services_number=444888555, ) self.__open_form_url(issuer) @@ -40,7 +41,7 @@ def test_form_normal_organisation(self): "address", "zipcode", "city", - "france_services_number", # only if france_service_label=True + "france_services_number", # only needed if france_service_label=True "web_site", "mission_description", "avg_nb_demarches", @@ -64,11 +65,12 @@ def test_form_normal_organisation(self): WebDriverWait(self.selenium, 10).until(url_matches(f"^.+{path}$")) - def test_form_other_organisation(self): + def test_form_other_type_and_private_organisation(self): issuer: Issuer = IssuerFactory() request: OrganisationRequest = OrganisationRequestFactory.build( type_id=RequestOriginConstants.OTHER.value, public_service_delegation_attestation=False, + partner_administration="Beta.Gouv", ) self.__open_form_url(issuer) @@ -85,7 +87,7 @@ def test_form_other_organisation(self): "address", "zipcode", "city", - "partner_administration", # only if is_private_org=True + "partner_administration", # needed only if is_private_org=True "web_site", "mission_description", "avg_nb_demarches", From 972edfd670ee4e33eb7061f6f552831496479f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Fri, 25 Mar 2022 18:07:55 +0100 Subject: [PATCH 16/17] Fix tests not dealing with checkboxes very well --- aidants_connect_habilitation/forms.py | 8 ------- .../tests/factories.py | 2 -- .../tests/test_views.py | 23 +++++++++++++++---- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/aidants_connect_habilitation/forms.py b/aidants_connect_habilitation/forms.py index 1404c0e47..a14d77658 100644 --- a/aidants_connect_habilitation/forms.py +++ b/aidants_connect_habilitation/forms.py @@ -7,7 +7,6 @@ BooleanField, CharField, ChoiceField, - FileField, modelformset_factory, ) from django.forms.formsets import MAX_NUM_FORM_COUNT, TOTAL_FORM_COUNT @@ -109,12 +108,6 @@ class OrganisationRequestForm(PatchedErrorListForm): required=False, ) - public_service_delegation_attestation = FileField( - label="Téléversez ici une attestation de délégation de service public", - help_text="Taille maximale : 2 Mo. Formats supportés : PDF, JPG, PNG.", - required=False, - ) - def __init__(self, **kwargs): super().__init__(**kwargs) @@ -200,7 +193,6 @@ class Meta: "city", "is_private_org", "partner_administration", - "public_service_delegation_attestation", "france_services_label", "france_services_number", "web_site", diff --git a/aidants_connect_habilitation/tests/factories.py b/aidants_connect_habilitation/tests/factories.py index 14e866ab8..b54dd0385 100644 --- a/aidants_connect_habilitation/tests/factories.py +++ b/aidants_connect_habilitation/tests/factories.py @@ -103,8 +103,6 @@ class OrganisationRequestFactory(DjangoModelFactory): zipcode = FactoryFaker("postcode") city = FactoryFaker("city") - public_service_delegation_attestation = "" - france_services_label = False web_site = FactoryFaker("url") diff --git a/aidants_connect_habilitation/tests/test_views.py b/aidants_connect_habilitation/tests/test_views.py index 61e9c7fca..cf4486761 100644 --- a/aidants_connect_habilitation/tests/test_views.py +++ b/aidants_connect_habilitation/tests/test_views.py @@ -14,7 +14,10 @@ from faker.config import DEFAULT_LOCALE from aidants_connect import settings -from aidants_connect.common.constants import RequestStatusConstants +from aidants_connect.common.constants import ( + RequestOriginConstants, + RequestStatusConstants, +) from aidants_connect_habilitation.forms import ( AidantRequestFormSet, DataPrivacyOfficerForm, @@ -444,9 +447,12 @@ def test_template(self): self.assertTemplateUsed(response, self.template_name) def test_redirect_valid_post_to_new_aidants(self): - cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" + cleaned_data = utils.get_form( + OrganisationRequestForm, type_id=RequestOriginConstants.MEDIATHEQUE.value + ).clean() cleaned_data["type"] = cleaned_data["type"].id + cleaned_data.pop("is_private_org") + cleaned_data.pop("france_services_label") response = self.client.post( reverse( @@ -456,6 +462,10 @@ def test_redirect_valid_post_to_new_aidants(self): cleaned_data, ) + self.assertTrue( + OrganisationRequest.objects.filter(issuer=self.issuer).exists(), + "No organisationrequest was created in DB", + ) self.assertRedirects( response, reverse( @@ -569,16 +579,19 @@ def test_on_correct_issuer_id_post_updates_model(self): raise ValueError(str(form.errors)) cleaned_data = form.clean() - cleaned_data["public_service_delegation_attestation"] = "" cleaned_data["type"] = cleaned_data["type"].id + # it is not enough to set these keys to False, + # we need to unset them from the POST as they are checkboxes in the form. + cleaned_data.pop("is_private_org") + cleaned_data.pop("france_services_label") + self.assertNotEqual(model.name, new_name) response = self.client.post( self.get_url(model.issuer.issuer_id, model.uuid), cleaned_data, ) - self.assertRedirects( response, reverse( From cabd264be413e2d475d9eba64636cd642b33af2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agn=C3=A8s=20Haasser?= Date: Mon, 28 Mar 2022 10:06:47 +0200 Subject: [PATCH 17/17] Clear references to public_service_attestation_delegation in tests --- .../tests/test_functionnal/test_organisation_form.py | 3 --- aidants_connect_habilitation/tests/test_views.py | 8 -------- 2 files changed, 11 deletions(-) diff --git a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py index b4c1bce54..78542b8aa 100644 --- a/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py +++ b/aidants_connect_habilitation/tests/test_functionnal/test_organisation_form.py @@ -25,7 +25,6 @@ def test_form_normal_organisation_with_fs_label(self): issuer: Issuer = IssuerFactory() request: OrganisationRequest = OrganisationRequestFactory.build( type_id=RequestOriginConstants.MEDIATHEQUE.value, - public_service_delegation_attestation=False, france_services_number=444888555, ) self.__open_form_url(issuer) @@ -69,7 +68,6 @@ def test_form_other_type_and_private_organisation(self): issuer: Issuer = IssuerFactory() request: OrganisationRequest = OrganisationRequestFactory.build( type_id=RequestOriginConstants.OTHER.value, - public_service_delegation_attestation=False, partner_administration="Beta.Gouv", ) self.__open_form_url(issuer) @@ -161,7 +159,6 @@ def test_submit_both_known_organisation_type_and_other_type(self): issuer: Issuer = IssuerFactory() request: OrganisationRequest = OrganisationRequestFactory.build( type_id=RequestOriginConstants.MEDIATHEQUE.value, - public_service_delegation_attestation=False, ) self.__open_form_url(issuer) diff --git a/aidants_connect_habilitation/tests/test_views.py b/aidants_connect_habilitation/tests/test_views.py index cf4486761..50b5e1da2 100644 --- a/aidants_connect_habilitation/tests/test_views.py +++ b/aidants_connect_habilitation/tests/test_views.py @@ -419,7 +419,6 @@ def test_404_on_bad_issuer_id(self): self.assertEqual(response.status_code, 404) cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" response: HttpResponse = self.client.post( reverse(self.pattern_name, kwargs={"issuer_id": uuid}), cleaned_data ) @@ -510,7 +509,6 @@ def test_404_on_bad_issuer_id(self): uuid = uuid4() cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" response = self.client.post( self.get_url(self.organisation.issuer.issuer_id, uuid), cleaned_data, @@ -522,7 +520,6 @@ def test_404_on_bad_uuid(self): self.assertEqual(response.status_code, 404) cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" cleaned_data["type"] = cleaned_data["type"].id response = self.client.post( @@ -636,7 +633,6 @@ def test_404_on_bad_issuer_id(self): uuid = uuid4() cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" response = self.client.post( self.get_url(self.organisation.issuer.issuer_id, uuid), cleaned_data, @@ -652,7 +648,6 @@ def test_404_on_unrelated_issuer_id(self): self.assertEqual(response.status_code, 404) cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" response = self.client.post( self.get_url(unrelated_issuer.issuer_id, self.organisation.uuid), cleaned_data, @@ -666,7 +661,6 @@ def test_404_on_bad_uuid(self): self.assertEqual(response.status_code, 404) cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" cleaned_data["type"] = cleaned_data["type"].id response = self.client.post( @@ -776,7 +770,6 @@ def test_404_on_bad_issuer_id(self): uuid = uuid4() cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" response = self.client.post( self.get_url(organisation.issuer.issuer_id, uuid), cleaned_data, @@ -790,7 +783,6 @@ def test_404_on_bad_uuid(self): self.assertEqual(response.status_code, 404) cleaned_data = utils.get_form(OrganisationRequestForm).clean() - cleaned_data["public_service_delegation_attestation"] = "" cleaned_data["type"] = cleaned_data["type"].id response = self.client.post(