mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-13 08:51:38 +08:00
Merge branch 'release_23.2' into dev
This commit is contained in:
@@ -9647,11 +9647,12 @@ class PSAAssociation(Base, AssociationMixin, RepresentById):
|
||||
|
||||
@classmethod
|
||||
def store(cls, server_url, association):
|
||||
try:
|
||||
def get_or_create():
|
||||
stmt = select(PSAAssociation).filter_by(server_url=server_url, handle=association.handle).limit(1)
|
||||
assoc = cls.sa_session.scalars(stmt).first()
|
||||
except IndexError:
|
||||
assoc = cls(server_url=server_url, handle=association.handle)
|
||||
return assoc or cls(server_url=server_url, handle=association.handle)
|
||||
|
||||
assoc = get_or_create()
|
||||
assoc.secret = base64.encodebytes(association.secret).decode()
|
||||
assoc.issued = association.issued
|
||||
assoc.lifetime = association.lifetime
|
||||
@@ -9663,7 +9664,7 @@ class PSAAssociation(Base, AssociationMixin, RepresentById):
|
||||
@classmethod
|
||||
def get(cls, *args, **kwargs):
|
||||
stmt = select(PSAAssociation).filter_by(*args, **kwargs)
|
||||
return cls.sa_session.scalars(stmt)
|
||||
return cls.sa_session.scalars(stmt).all()
|
||||
|
||||
@classmethod
|
||||
def remove(cls, ids_to_delete):
|
||||
|
||||
Reference in New Issue
Block a user