Skip to content

Commit

Permalink
Rename process_all to process_sql. Remove process_csv
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Aug 1, 2024
1 parent 7a5c631 commit 58dd435
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
23 changes: 3 additions & 20 deletions backend/gn_module_monitoring/command/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
)


@click.command("process_all")
@click.command("process_sql")
@click.argument("module_code", type=str, required=False, default="")
@with_appcontext
def cmd_process_all(module_code):
def cmd_process_sql(module_code):
"""
Met à jour les paramètres de configuration pour un module
Fichiers sql synthese et export
Expand All @@ -44,22 +44,6 @@ def cmd_process_all(module_code):
process_sql_files(dir="exports/csv", module_code=module, depth=None, allowed_files=None)


@click.command("process_export_csv")
@click.argument("module_code", type=str, required=False, default="")
@with_appcontext
def cmd_process_export_csv(module_code):
"""
Met à jour les fichiers pour les exports pdf
"""
if module_code:
modules = [module_code]
else:
modules = [module["module_code"] for module in installed_modules()]

for module in modules:
process_sql_files(dir="exports/csv", module_code=module, depth=None, allowed_files=None)


@click.command("install")
@click.argument("module_code", type=str, required=False, default="")
@with_appcontext
Expand Down Expand Up @@ -249,11 +233,10 @@ def synchronize_synthese(module_code, offset):


commands = [
cmd_process_export_csv,
cmd_install_monitoring_module,
cmd_process_available_permission_module,
cmd_remove_monitoring_module_cmd,
cmd_add_module_nomenclature_cli,
cmd_process_all,
cmd_process_sql,
synchronize_synthese,
]
2 changes: 1 addition & 1 deletion backend/gn_module_monitoring/command/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

FORBIDDEN_SQL_INSTRUCTION = [
"INSERT ",
"DROP ",
"DELETE ",
"UPDATE ",
"EXECUTE ",
Expand All @@ -48,6 +47,7 @@
"GRANT ",
"COPY ",
"PERFORM ",
"CASCADE",
]

PERMISSION_LABEL = {
Expand Down

0 comments on commit 58dd435

Please sign in to comment.