Skip to content

Commit

Permalink
debug celery tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Jan 24, 2024
1 parent ef46352 commit 9860a6a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions backend/geonature/core/gn_commons/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ class TValidations(DB.Model):
overlaps="nomenclature_valid_status", # overlaps expected
)

@staticmethod
def auto_validation(fct_auto_validation):
stmt = text(
f"""
Expand All @@ -246,9 +247,8 @@ def auto_validation(fct_auto_validation):
if not result:
return
stmt_auto_validation = text(f"SELECT gn_profiles.{fct_auto_validation}()")
list_synthese_updated = DB.session.execute(stmt_auto_validation).fetchall()[0]
# DB.session.query(func.gn_profiles.fct_auto_validation())
return list_synthese_updated
DB.session.execute(stmt_auto_validation)
DB.session.commit()


last_validation_query = (
Expand Down
23 changes: 12 additions & 11 deletions contrib/gn_module_validation/validation_config.toml.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# PARAMETRES CONFIG MODULE VALIDATION

# Uncomment the following line to enable the auto-validation (value must be equal to true)
#AUTO_VALIDATION_ENABLED = true

### Cron parameters for the auto-validation
#AUTO_VALIDATION_CRONTAB = "* 1 * * *"

## If the auto-validation function do not fit your usecase, be sure to create your own
## and indicate its name in the following variable
## ATTENTION : Be sure that your function is declared in the `gn_profiles` schema in the database

#AUTO_VALIDATION_SQL_FUNCTION = "fct_auto_validation_custom"

[[COLUMN_LIST]]
column_label = "Taxon"
column_name = "taxref.nom_vern_or_lb_nom"
Expand Down Expand Up @@ -27,14 +39,3 @@ min_width = 100
#min_width = 50


# Uncomment the following line to enable the auto-validation (value must be equal to true)
#AUTO_VALIDATION_ENABLED = true

### Cron parameters for the auto-validation
#AUTO_VALIDATION_CRONTAB = "* 1 * * *"

## If the auto-validation function do not fit your usecase, be sure to create your own
## and indicate its name in the following variable
## ATTENTION : Be sure that your function is declared in the `gn_profiles` schema in the database

#AUTO_VALIDATION_SQL_FUNCTION = "fct_auto_validation_custom"

0 comments on commit 9860a6a

Please sign in to comment.