def _verification_get(self, verification_uuid, session=None): verification = self.model_query( models.Verification, session=session).filter_by(uuid=verification_uuid).first() if not verification: raise exceptions.ResourceNotFound(id=verification_uuid) return verification
def _verifier_get(self, verifier_id, session=None): verifier = self.model_query(models.Verifier, session=session).filter( or_(models.Verifier.name == verifier_id, models.Verifier.uuid == verifier_id)).first() if not verifier: raise exceptions.ResourceNotFound(id=verifier_id) return verifier
def verification_delete(self, verification_uuid): session = get_session() with session.begin(): count = self.model_query( models.Verification, session=session).filter_by( uuid=verification_uuid).delete(synchronize_session=False) if not count: raise exceptions.ResourceNotFound(id=verification_uuid)
def verifier_delete(self, verifier_id): session = get_session() with session.begin(): query = self.model_query(models.Verifier, session=session).filter( or_(models.Verifier.name == verifier_id, models.Verifier.uuid == verifier_id)) count = query.delete(synchronize_session=False) if not count: raise exceptions.ResourceNotFound(id=verifier_id)
def resource_delete(self, id): count = (self.model_query(models.Resource).filter_by(id=id).delete( synchronize_session=False)) if not count: raise exceptions.ResourceNotFound(id=id)