Skip to content

Commit

Permalink
PnX-SI#2034 - fix actors info in dataset PDF
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaetanbrl committed Dec 21, 2022
1 parent 7c07240 commit d579db0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/geonature/core/gn_meta/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,17 +444,18 @@ def get_export_pdf_dataset(scope):
dataset = TDatasets.query.get_or_404(id_dataset)
if not dataset.has_instance_permission(scope=scope):
raise Forbidden("Vous n'avez pas les droits d'exporter ces informations")

dataset_schema = DatasetSchema(
only=[
"nomenclature_data_type",
"nomenclature_dataset_objectif",
"nomenclature_collecting_method",
"acquisition_framework",
"cor_dataset_actor.nomenclature_actor_role",
"cor_dataset_actor.organism",
"cor_dataset_actor.role",
]
)
dataset = dataset_schema.dump(dataset)

if len(dataset.get("dataset_desc")) > 240:
dataset["dataset_desc"] = dataset.get("dataset_desc")[:240] + "..."

Expand Down

0 comments on commit d579db0

Please sign in to comment.