mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
update course state also
This commit is contained in:
@@ -1344,8 +1344,9 @@ def doUpdateCourse():
|
|||||||
i += 2
|
i += 2
|
||||||
elif sys.argv[i].lower() in [u'state', u'status']:
|
elif sys.argv[i].lower() in [u'state', u'status']:
|
||||||
body[u'courseState'] = sys.argv[i+1].upper()
|
body[u'courseState'] = sys.argv[i+1].upper()
|
||||||
if body[u'courseState'] not in [u'ACTIVE', u'ARCHIVED', u'PROVISIONED', u'DECLINED']:
|
valid_states = croom._rootDesc[u'schemas'][u'Course'][u'properties'][u'courseState'][u'enum']
|
||||||
print u'ERROR: course state must be active or archived; got %s' % body[u'courseState']
|
if body[u'courseState'] not in valid_states:
|
||||||
|
print u'ERROR: course state must be one of: %s. Got %s' % (u', '.join(valid_states).lower(), body[u'courseState'])
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
@@ -2046,7 +2047,7 @@ def doCreateCourse():
|
|||||||
body[u'courseState'] = sys.argv[i+1].upper()
|
body[u'courseState'] = sys.argv[i+1].upper()
|
||||||
valid_states = croom._rootDesc[u'schemas'][u'Course'][u'properties'][u'courseState'][u'enum']
|
valid_states = croom._rootDesc[u'schemas'][u'Course'][u'properties'][u'courseState'][u'enum']
|
||||||
if body[u'courseState'] not in valid_states:
|
if body[u'courseState'] not in valid_states:
|
||||||
print u'ERROR: course state must be one of: %s. Got %s' % (u', '.join(valid_states), body[u'courseState'])
|
print u'ERROR: course state must be one of: %s. Got %s' % (u', '.join(valid_states).lower(), body[u'courseState'])
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
i += 2
|
i += 2
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user