diff --git a/apptax/migrations/versions/fd5ed3f94d0f_add_groupe3_inpn_to_bib_listes.py b/apptax/migrations/versions/fd5ed3f94d0f_add_groupe3_inpn_to_bib_listes.py index 2fdbac53..0621b391 100644 --- a/apptax/migrations/versions/fd5ed3f94d0f_add_groupe3_inpn_to_bib_listes.py +++ b/apptax/migrations/versions/fd5ed3f94d0f_add_groupe3_inpn_to_bib_listes.py @@ -10,8 +10,8 @@ # revision identifiers, used by Alembic. -revision = 'fd5ed3f94d0f' -down_revision = '3bd542b72955' +revision = "fd5ed3f94d0f" +down_revision = "3bd542b72955" branch_labels = None depends_on = None diff --git a/apptax/taxonomie/routesbibattributs.py b/apptax/taxonomie/routesbibattributs.py index c35156b3..22e5382a 100644 --- a/apptax/taxonomie/routesbibattributs.py +++ b/apptax/taxonomie/routesbibattributs.py @@ -34,7 +34,7 @@ def get_bibattributsbyTaxref(regne, group2_inpn=None): q = q.filter( or_(BibAttributs.group2_inpn == group2_inpn, BibAttributs.group2_inpn == None) ) - #TODO: ajouter group3_inpn ? + # TODO: ajouter group3_inpn ? results = q.all() attDict = {} diff --git a/apptax/taxonomie/routesbiblistes.py b/apptax/taxonomie/routesbiblistes.py index c466c1d6..c569ba14 100644 --- a/apptax/taxonomie/routesbiblistes.py +++ b/apptax/taxonomie/routesbiblistes.py @@ -51,7 +51,13 @@ def get_biblistesbyTaxref(regne, group_inpn=None): if regne: q = q.filter(or_(BibListes.regne == regne, BibListes.regne == None)) if group_inpn: - q = q.filter(or_(BibListes.group2_inpn == group_inpn, BibListes.group3_inpn == group_inpn, BibListes.group2_inpn == None)) + q = q.filter( + or_( + BibListes.group2_inpn == group_inpn, + BibListes.group3_inpn == group_inpn, + BibListes.group2_inpn == None, + ) + ) results = q.all() return [liste.as_dict() for liste in results] diff --git a/apptax/taxonomie/routestaxref.py b/apptax/taxonomie/routestaxref.py index cea0429d..22d3c945 100644 --- a/apptax/taxonomie/routestaxref.py +++ b/apptax/taxonomie/routestaxref.py @@ -315,6 +315,7 @@ def get_regneGroup2Inpn_taxref(): results[d.regne] = ["", d.group2_inpn] return results + @adresses.route("/regnewithgroupe3", methods=["GET"]) @json_resp def get_regneGroup3Inpn_taxref(): @@ -338,6 +339,7 @@ def get_regneGroup3Inpn_taxref(): results[d.regne] = ["", d.group3_inpn] return results + @adresses.route("/allnamebylist/", methods=["GET"]) @adresses.route("/allnamebylist", methods=["GET"]) @json_resp @@ -421,7 +423,7 @@ def get_AllTaxrefNameByListe(code_liste=None): if group2_inpn: q = q.filter(VMTaxrefListForautocomplete.group2_inpn == group2_inpn) - #TODO: add group3 here after migration + # TODO: add group3 here after migration limit = request.args.get("limit", 20, int) page = request.args.get("page", 1, int)