Skip to content
Snippets Groups Projects
Verified Commit 9af451fd authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

model: Allow new status values not_found and failed to OriginVisitStatus

Related to T2961
parent 1ca92a5c
No related branches found
Tags v0.11.0
No related merge requests found
......@@ -175,7 +175,9 @@ def origin_visit_statuses_d():
visit=integers(1, 1000),
origin=urls(),
type=optional(sampled_from(["git", "svn", "pypi", "debian"])),
status=sampled_from(["created", "ongoing", "full", "partial"]),
status=sampled_from(
["created", "ongoing", "full", "partial", "not_found", "failed"]
),
date=aware_datetimes(),
snapshot=optional(sha1_git()),
metadata=optional(metadata_dicts()),
......
......@@ -320,7 +320,9 @@ class OriginVisitStatus(BaseModel):
date = attr.ib(type=datetime.datetime, validator=type_validator())
status = attr.ib(
type=str,
validator=attr.validators.in_(["created", "ongoing", "full", "partial"]),
validator=attr.validators.in_(
["created", "ongoing", "full", "partial", "not_found", "failed"]
),
)
snapshot = attr.ib(type=Optional[Sha1Git], validator=type_validator())
# Type is optional be to able to use it before adding it to the database model
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment