Merge branch 'release_23.2' into dev

This commit is contained in:
John Davis
2024-02-22 10:34:45 -05:00
+5 -4
View File
@@ -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):