

def get_current_sha(self, env):
    from freight.models import Task, Deploy, TaskStatus
    return db.session.query(Task.sha).filter((Deploy.task_id == Task.id), (Task.app_id == self.id), (Deploy.environment == env), (Task.status == TaskStatus.finished)).order_by(Deploy.number.desc()).limit(1).scalar()

dataset/ETHPy150Open getsentry/freight/freight/models/app.py App.get_current_sha/original