From ddf1135edae9cd0519aa60519be6065c86eb3c62 Mon Sep 17 00:00:00 2001 From: Sergey Golitsynskiy Date: Fri, 8 Oct 2021 17:44:23 -0400 Subject: [PATCH] Replace backref w/back_populates for User/APIKeys --- lib/tool_shed/webapp/model/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tool_shed/webapp/model/__init__.py b/lib/tool_shed/webapp/model/__init__.py index c9ba9132776..eb2127a3668 100644 --- a/lib/tool_shed/webapp/model/__init__.py +++ b/lib/tool_shed/webapp/model/__init__.py @@ -75,6 +75,7 @@ class APIKeys(Base, _HasTable): create_time = Column(DateTime, default=now) user_id = Column(Integer, ForeignKey('galaxy_user.id'), index=True) key = Column(TrimmedString(32), index=True, unique=True) + user = relationship('User', back_populates='api_keys') class User(Base, Dictifiable, _HasTable): @@ -98,7 +99,7 @@ class User(Base, Dictifiable, _HasTable): order_by=lambda: desc(GalaxySession.update_time)) # type: ignore api_keys = relationship( 'APIKeys', - backref="user", # TODO >> back_populates + back_populates='user', order_by=lambda: desc(APIKeys.create_time)) # type: ignore reset_tokens = relationship('PasswordResetToken', back_populates='user')