Skip to content

Commit

Permalink
Fix backref_cascase in TS's model
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavcs committed Mar 8, 2022
1 parent 7f51ead commit 5844d2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/tool_shed/webapp/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
TrimmedString,
)
from galaxy.model.orm.now import now
from galaxy.model.orm.util import add_object_to_object_session
from galaxy.security.validate_user_input import validate_password_str
from galaxy.util import unique_id
from galaxy.util.bunch import Bunch
Expand Down Expand Up @@ -182,6 +183,7 @@ def __init__(self, user, token=None):
self.token = token
else:
self.token = unique_id()
add_object_to_object_session(self, user)
self.user = user
self.expiration_time = now() + timedelta(hours=24)

Expand Down Expand Up @@ -252,6 +254,7 @@ class UserGroupAssociation(Base, _HasTable):
group = relationship("Group", back_populates="users")

def __init__(self, user, group):
add_object_to_object_session(self, user)
self.user = user
self.group = group

Expand All @@ -268,7 +271,9 @@ class UserRoleAssociation(Base, _HasTable):
role = relationship("Role", back_populates="users")

def __init__(self, user, role):
add_object_to_object_session(self, user)
self.user = user
add_object_to_object_session(self, role)
self.role = role


Expand Down Expand Up @@ -300,6 +305,7 @@ class RepositoryRoleAssociation(Base, _HasTable):
role = relationship("Role", back_populates="repositories")

def __init__(self, repository, role):
add_object_to_object_session(self, repository)
self.repository = repository
self.role = role

Expand Down

0 comments on commit 5844d2c

Please sign in to comment.