Merge pull request 'lacre.repositories: Fix IdentityRepository existence predicate' (#133) from 132-fix-repo-upsert into main

Reviewed-on: #133
This commit is contained in:
pfm 2023-12-04 21:59:00 +00:00
commit 4c603839b5

View file

@ -40,9 +40,7 @@ class IdentityRepository(KeyRing):
def _exists(self, email: str) -> bool:
self._ensure_connected()
selq = select(self._identities.c.email).where(self._identities.c.email == email)
emails = [e for e in self._conn.execute(selq)]
assert len(emails) == 1
return emails
return [e for e in self._conn.execute(selq)]
def _insert(self, email, fprint):
self._ensure_connected()