Skip to content

Comments

Feat: import monitoring sites groups#575

Draft
IdrissaD wants to merge 7 commits intoPnX-SI:feat/import-monitoringfrom
naturalsolutions:feat/import-monitoring-sites-groups
Draft

Feat: import monitoring sites groups#575
IdrissaD wants to merge 7 commits intoPnX-SI:feat/import-monitoringfrom
naturalsolutions:feat/import-monitoring-sites-groups

Conversation

@IdrissaD
Copy link

@IdrissaD IdrissaD commented Feb 18, 2026

Fixes #574

  • ajout d'une colonne id_import à TMonitoringSitesGroups
  • ajout des groupes de sites à la logique d'import sur un modèle similaire aux sites et visites
  • gestion du fait qu'il peut y avoir des sites sans parent (certains protocoles ont des sites mais pas de groupes de sites)

Dépend de la PR #573 pour une fonction.

@IdrissaD IdrissaD force-pushed the feat/import-monitoring-sites-groups branch from d687d99 to acdc1ba Compare February 18, 2026 14:34
@jacquesfize jacquesfize force-pushed the feat/import-monitoring branch from 3d34ad8 to b509eca Compare February 18, 2026 14:58
@IdrissaD IdrissaD force-pushed the feat/import-monitoring-sites-groups branch from acdc1ba to 0d9c0a0 Compare February 19, 2026 09:25
id_destination=id_destination,
bib_themes=bib_themes,
is_parent_link=True,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

un des get_cor_entity_field a disparu dans cette histoire. C4est normal ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bien vu, corrigé !

@@ -1,30 +1,30 @@
from gn_module_monitoring.monitoring.import_actions.visit_actions import VisitImportActions
from .entity_import_actions_utils import EntityImportActionsUtils
Copy link

@edelclaux edelclaux Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

je trouve bizarre toutes ces modfis la (tout le fichier). C4est pas une fausse manip ?

@@ -1,23 +1,31 @@
from flask import current_app
from .entity_import_actions_utils import EntityImportActionsUtils

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pareil, toutes ces modifs d'import sont étranges.

imprt, SitesGroupImportActions.ENTITY_CODE
)

if SitesGroupImportActions.ID_FIELD: # FIXME

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pourquoi fixme ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'avais oublié d'enlever cette ligne qui ne fonctionnait même pas comme prévu. Remplacé par dbd3ac6#diff-9951c3fbfb0a9107563934d70e23e7706c50ce37d9a079f232d1e03f94cdf8b7R322

Mais je suis pas satisfait de la gestion de ce check, qui peut laisser passer des erreurs dans le cas suivant :

  • module avec groupes de sites activés
  • groupes de sites non obligatoires (entité "site" au même niveau que "sites_group" dans config.json d'un protocole)
  • uuid_group quand même renseigné à l'import d'un site, mais cet uuid ne correspond à aucun groupe

@@ -1,34 +1,36 @@
from .entity_import_actions_utils import EntityImportActionsUtils
from geonature.core.imports.checks.sql.parent import set_parent_line_no
from geonature.utils.env import db

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

étrange toutes ces modifs d'import

@IdrissaD IdrissaD marked this pull request as draft February 19, 2026 13:29
if SitesGroupImportActions.ID_FIELD: # FIXME
if (
isSitesGroupMandatory
): # FIXME : idéalement vérifier chaque ligne pour appliquer la vérification uniquement en cas de présence d'un id_parent
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bricolage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants