Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/synthese test #2950

Merged
merged 4 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/geonature/core/gn_synthese/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ class VSyntheseForWebApp(DB.Model):
id_module = DB.Column(DB.Integer)
entity_source_pk_value = DB.Column(DB.Integer)
id_dataset = DB.Column(DB.Integer)
dataset_name = DB.Column(DB.Integer)
dataset_name = DB.Column(DB.String)
id_acquisition_framework = DB.Column(DB.Integer)
count_min = DB.Column(DB.Integer)
count_max = DB.Column(DB.Integer)
Expand Down
10 changes: 4 additions & 6 deletions backend/geonature/core/gn_synthese/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
g,
)
from geonature.core.gn_synthese.schemas import SyntheseSchema
from geonature.core.gn_synthese.synthese_config import MANDATORY_COLUMNS
from pypnusershub.db.models import User
from pypnnomenclature.models import BibNomenclaturesTypes, TNomenclatures
from werkzeug.exceptions import Forbidden, NotFound, BadRequest, Conflict
Expand Down Expand Up @@ -151,12 +152,9 @@ def get_observations_for_web(permissions):
col["prop"] for col in current_app.config["SYNTHESE"]["LIST_COLUMNS_FRONTEND"]
}
# Init with compulsory columns
columns = [
"id",
VSyntheseForWebApp.id_synthese,
"url_source",
VSyntheseForWebApp.url_source,
]
columns = []
for col in MANDATORY_COLUMNS:
columns.extend([col, getattr(VSyntheseForWebApp, col)])

if "count_min_max" in param_column_list:
count_min_max = case(
Expand Down
10 changes: 9 additions & 1 deletion backend/geonature/core/gn_synthese/schemas.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
from geonature.utils.env import db, ma
from geonature.utils.config import config

from geonature.core.gn_commons.schemas import ModuleSchema, MediaSchema, TValidationSchema
from geonature.core.gn_synthese.models import BibReportsTypes, TReport, TSources, Synthese
from geonature.core.gn_synthese.models import (
BibReportsTypes,
TReport,
TSources,
Synthese,
VSyntheseForWebApp,
)
from geonature.core.gn_synthese.synthese_config import MANDATORY_COLUMNS

from pypn_habref_api.schemas import HabrefSchema
from pypnusershub.schemas import UserSchema
Expand Down
2 changes: 1 addition & 1 deletion backend/geonature/core/gn_synthese/synthese_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
]

# Mandatory columns for the frontend in Synthese API
MANDATORY_COLUMNS = ["entity_source_pk_value", "url_source", "cd_nom"]
MANDATORY_COLUMNS = ["id_synthese", "entity_source_pk_value", "url_source", "cd_nom"]

# CONFIG MAP-LIST
DEFAULT_LIST_COLUMN = [
Expand Down
Loading
Loading