From 29dcb8b2e9099c2c21124c8d3666f1fe69ca312d Mon Sep 17 00:00:00 2001 From: TheoLechemia Date: Mon, 30 Oct 2023 14:55:54 +0100 Subject: [PATCH] Add property max_level_profil to default exclude columns -> it make raise a raiseload error on some module --- src/pypnusershub/db/models.py | 1 - src/pypnusershub/schemas.py | 2 +- src/pypnusershub/tests/test_utils.py | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pypnusershub/db/models.py b/src/pypnusershub/db/models.py index 080d723..96f0959 100644 --- a/src/pypnusershub/db/models.py +++ b/src/pypnusershub/db/models.py @@ -133,7 +133,6 @@ class User(db.Model, UserMixin): active = db.Column(db.Boolean) groups = db.relationship( "User", - lazy="joined", secondary=cor_roles, primaryjoin="User.id_role == utilisateurs.cor_roles.c.id_role_utilisateur", secondaryjoin="User.id_role == utilisateurs.cor_roles.c.id_role_groupe", diff --git a/src/pypnusershub/schemas.py b/src/pypnusershub/schemas.py index b67889a..059f651 100644 --- a/src/pypnusershub/schemas.py +++ b/src/pypnusershub/schemas.py @@ -12,7 +12,7 @@ class Meta: include_fk = True load_instance = True sqla_session = db.session - exclude = ("_password", "_password_plus", "champs_addi") + exclude = ("_password", "_password_plus", "champs_addi", "max_level_profil") max_level_profil = fields.Integer() nom_complet = fields.String() diff --git a/src/pypnusershub/tests/test_utils.py b/src/pypnusershub/tests/test_utils.py index 5f66af4..3f1ec96 100644 --- a/src/pypnusershub/tests/test_utils.py +++ b/src/pypnusershub/tests/test_utils.py @@ -6,8 +6,6 @@ from pypnusershub.utils import get_cookie_path, set_cookie, delete_cookie -from .utils import set_logged_user_cookie - class TestUtils: @pytest.mark.parametrize(