diff --git a/tahrir_api/dbapi.py b/tahrir_api/dbapi.py index 4384c84..93f664f 100644 --- a/tahrir_api/dbapi.py +++ b/tahrir_api/dbapi.py @@ -306,7 +306,10 @@ def get_assertions_by_email(self, person_email): session = scoped_session(self.session_maker) if self.person_exists(person_email): - return session.query(Assertion).filter_by(email=person_email).all() + person_id = session.query(Person).filter_by( + email=person_email).one().id + return session.query(Assertion).filter_by( + person_id=person_id).all() else: return False