mirror of
https://github.com/sartography/cr-connect-workflow.git
synced 2025-02-22 12:48:25 +00:00
Fixed the class names
This commit is contained in:
parent
fa61aa0354
commit
6be9529b22
@ -3,7 +3,7 @@ from crc.models.study import StudyModel
|
||||
from crc.scripts.script import Script
|
||||
|
||||
|
||||
class StudyStatus(Script):
|
||||
class GetStudyStatus(Script):
|
||||
|
||||
def get_description(self):
|
||||
return """Get the status of the current study.
|
||||
|
@ -4,7 +4,7 @@ from crc.models.study import StudyModel, StudyStatus
|
||||
from crc.scripts.script import Script
|
||||
|
||||
|
||||
class MyScript(Script):
|
||||
class SetStudyStatus(Script):
|
||||
|
||||
def get_description(self):
|
||||
return """Set the status of the current study.
|
||||
@ -18,6 +18,7 @@ class MyScript(Script):
|
||||
new_status = kwargs['status']
|
||||
elif len(args) > 0:
|
||||
new_status = args[0]
|
||||
|
||||
try:
|
||||
study_status = getattr(StudyStatus, new_status)
|
||||
|
||||
@ -26,6 +27,7 @@ class MyScript(Script):
|
||||
message=f"We could not find a status matching `{new_status}`. Original message: {ae}",
|
||||
task=task)
|
||||
return study_status.value
|
||||
|
||||
else:
|
||||
raise ApiError.from_task(code='missing_argument',
|
||||
message='You must include the new status when calling `set_study_status` script. '
|
||||
|
Loading…
x
Reference in New Issue
Block a user