Fixed the class names

This commit is contained in:
mike cullerton 2021-12-03 11:53:21 -05:00
parent fa61aa0354
commit 6be9529b22
2 changed files with 4 additions and 2 deletions

View File

@ -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.

View File

@ -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. '