Skip to content

Commit

Permalink
Use the new reset flag on Fail QA (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
duartegalvao authored Jun 4, 2024
1 parent 3f09f60 commit 1b15403
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions openreferee_server/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Tag(str, Enum):
PROCESSED = "PRC"
QA_APPROVED = "QA01"
QA_PENDING = "QA02"
QA_FAILED = "QA03"


SERVICE_INFO = {"version": __version__, "name": "OpenReferee JACoW"}
Expand Down Expand Up @@ -35,6 +36,7 @@ class Tag(str, Enum):
Tag.PROCESSED: {"title": "Processed", "color": "brown", "system": True},
Tag.QA_APPROVED: {"title": "QA Approved", "color": "green", "system": True},
Tag.QA_PENDING: {"title": "QA Pending", "color": "yellow", "system": True},
Tag.QA_FAILED: {"title": "QA Failed", "color": "red", "system": True},
}
DEFAULT_EDITABLES = {"paper", "poster"}
DEFAULT_FILE_TYPES = {
Expand Down
7 changes: 2 additions & 5 deletions openreferee_server/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,10 @@ def process_custom_action(event, revision, action, user, endpoints):
"comments": [{"internal": True, "text": "This revision has passed QA."}],
}
elif action == "fail-qa":
response = session.post(
endpoints["revisions"]["reset"],
)
response.raise_for_status()
return {
"tags": revision_tags,
"tags": revision_tags + [available_tags[Tag.QA_FAILED]["id"]],
"publish": False,
"comments": [{"internal": True, "text": "This revision has failed QA."}],
"reset": True,
}
return {}
2 changes: 1 addition & 1 deletion openreferee_server/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class EditableEndpointsSchema(Schema):
"details": fields.String(required=True),
"replace": fields.String(required=True),
"undo": fields.String(required=True),
"reset": fields.String(required=True),
}
)
file_upload = fields.String(required=True)
Expand Down Expand Up @@ -216,3 +215,4 @@ class ServiceActionResultSchema(Schema):
comments = fields.List(fields.Nested(CommentSchema))
tags = fields.List(fields.Int())
redirect = fields.String(missing=None)
reset = fields.Boolean(missing=False)

0 comments on commit 1b15403

Please sign in to comment.