From 9b13011ea3ec3a6cfdb1a1376e2a1d56b64cfc62 Mon Sep 17 00:00:00 2001 From: AlexandreJunod Date: Thu, 29 Jun 2023 15:08:37 +0200 Subject: [PATCH] update api and section validation --- geocity/apps/api/serializers.py | 4 +++- .../reports/templates/reports/sections/sectionvalidation.html | 2 +- .../submissions/management/fixturize_data/demo_example.py | 2 +- .../apps/submissions/management/fixturize_data/fixturize.py | 2 +- .../submissions/management/fixturize_data/generic_example.py | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/geocity/apps/api/serializers.py b/geocity/apps/api/serializers.py index 560400e8b..3f62e5ea7 100644 --- a/geocity/apps/api/serializers.py +++ b/geocity/apps/api/serializers.py @@ -462,7 +462,9 @@ def to_representation(self, value): ): values[field.name] = getattr(validation, field.name) - rep[validation.department.group.name] = values + values["group_name"] = validation.department.group.name + values["description"] = validation.department.description + rep[convert_string_to_api_key(validation.department.group.name)] = values return rep diff --git a/geocity/apps/reports/templates/reports/sections/sectionvalidation.html b/geocity/apps/reports/templates/reports/sections/sectionvalidation.html index 6ff7819ca..18d4ee008 100644 --- a/geocity/apps/reports/templates/reports/sections/sectionvalidation.html +++ b/geocity/apps/reports/templates/reports/sections/sectionvalidation.html @@ -9,7 +9,7 @@
{% for group, validation in request_data.properties.validations.items %} -

Validation: {{group}}

+

Validation: {{validation.description}}

Statut : {{validation.validation_status}}
{% if validation.comment_is_visible_by_author %}
Commentaire : {{validation.comment}}

diff --git a/geocity/apps/submissions/management/fixturize_data/demo_example.py b/geocity/apps/submissions/management/fixturize_data/demo_example.py index e63dc7e0e..5cbb2474e 100644 --- a/geocity/apps/submissions/management/fixturize_data/demo_example.py +++ b/geocity/apps/submissions/management/fixturize_data/demo_example.py @@ -48,7 +48,7 @@ } field_title = { "name": "Texte permettant de séparer visuellement les champs", - "input_type": "title", + "input_type": "title_output", "help_text": "Ce texte permet d'expliquer en détail à l'utilisateur les pourquoi et le comment des informations à fournir", "is_mandatory": False, } diff --git a/geocity/apps/submissions/management/fixturize_data/fixturize.py b/geocity/apps/submissions/management/fixturize_data/fixturize.py index 4fe87f898..3f9ffc4d3 100644 --- a/geocity/apps/submissions/management/fixturize_data/fixturize.py +++ b/geocity/apps/submissions/management/fixturize_data/fixturize.py @@ -53,7 +53,7 @@ } field_title = { "name": "Texte permettant de séparer visuellement les champs", - "input_type": "title", + "input_type": "title_output", "help_text": "Ce texte permet d'expliquer en détail à l'utilisateur les pourquoi et le comment des informations à fournir", "is_mandatory": False, } diff --git a/geocity/apps/submissions/management/fixturize_data/generic_example.py b/geocity/apps/submissions/management/fixturize_data/generic_example.py index ccd18fb82..4876d5521 100644 --- a/geocity/apps/submissions/management/fixturize_data/generic_example.py +++ b/geocity/apps/submissions/management/fixturize_data/generic_example.py @@ -50,7 +50,7 @@ } field_title = { "name": "Texte permettant de séparer visuellement les champs", - "input_type": "title", + "input_type": "title_output", "help_text": "Ce texte permet d'expliquer en détail à l'utilisateur les pourquoi et le comment des informations à fournir", "is_mandatory": False, }