예제 #1
0
파일: api.py 프로젝트: joylhx/Rally
 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
예제 #2
0
파일: api.py 프로젝트: joylhx/Rally
 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
예제 #3
0
파일: api.py 프로젝트: joylhx/Rally
 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)
예제 #4
0
파일: api.py 프로젝트: joylhx/Rally
 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)
예제 #5
0
파일: api.py 프로젝트: joylhx/Rally
 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)