|
|
@@ -728,11 +728,14 @@ class SqlAlchemyScriptBusinessArtifactRepository:
|
|
|
row = await self._find_by_attempt(attempt_id)
|
|
|
if row is None:
|
|
|
raise ArtifactNotFound()
|
|
|
+ if ArtifactState(str(row["state"])) not in {
|
|
|
+ ArtifactState.FROZEN,
|
|
|
+ ArtifactState.PUBLISHED,
|
|
|
+ }:
|
|
|
+ raise ArtifactNotFound()
|
|
|
version = _version_from_row(row)
|
|
|
if version.script_build_id != script_build_id or version.task_id != task_id:
|
|
|
raise ArtifactOwnershipMismatch()
|
|
|
- if version.state not in {ArtifactState.FROZEN, ArtifactState.PUBLISHED}:
|
|
|
- raise ArtifactNotFound()
|
|
|
if canonical_sha256(_artifact_payload(version.artifact)).wire != version.canonical_sha256:
|
|
|
raise ArtifactDigestMismatch()
|
|
|
return version
|