From 5c556b8f050597489aa416fe6d159677da6e81f7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2020 11:39:44 +0000 Subject: Stop setting a backref on relations that are viewonly From sqlalachemy 1.3.14 relations that are specifying a backref when viewonly=True will issue a warning and this will be disallowed in future releases of sqlalchemy. So, after checking that these backref were not used in the project, we have simply removed them. Source: https://github.com/sqlalchemy/sqlalchemy/releases/tag/rel_1_3_14 which also explains why this behavior is not desired. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/model.py b/pagure/lib/model.py index 103bfc9..ea6413e 100644 --- a/pagure/lib/model.py +++ b/pagure/lib/model.py @@ -417,7 +417,6 @@ class Project(BASE): primaryjoin="projects.c.id==user_projects.c.project_id", secondaryjoin="and_(users.c.id==user_projects.c.user_id,\ user_projects.c.access=='admin')", - backref="co_projects_admins", viewonly=True, ) @@ -428,7 +427,6 @@ class Project(BASE): secondaryjoin="and_(users.c.id==user_projects.c.user_id,\ or_(user_projects.c.access=='commit',\ user_projects.c.access=='admin'))", - backref="co_projects_committers", viewonly=True, ) @@ -453,7 +451,6 @@ class Project(BASE): primaryjoin="projects.c.id==projects_groups.c.project_id", secondaryjoin="and_(pagure_group.c.id==projects_groups.c.group_id,\ projects_groups.c.access=='admin')", - backref="projects_admin_groups", order_by="PagureGroup.group_name.asc()", viewonly=True, ) @@ -465,7 +462,6 @@ class Project(BASE): secondaryjoin="and_(pagure_group.c.id==projects_groups.c.group_id,\ or_(projects_groups.c.access=='admin',\ projects_groups.c.access=='commit'))", - backref="projects_committer_groups", order_by="PagureGroup.group_name.asc()", viewonly=True, )