mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-04 04:41:35 +00:00
Guardian command cleanup
Upshift states list as a convenience to user; split on comma or space as in most other lists Tell user about invalid argument Keep pylint happy, eliminate extra spaces
This commit is contained in:
@@ -2315,11 +2315,14 @@ def doPrintGuardians():
|
|||||||
states = [u'COMPLETE', u'PENDING', u'GUARDIAN_INVITATION_STATE_UNSPECIFIED']
|
states = [u'COMPLETE', u'PENDING', u'GUARDIAN_INVITATION_STATE_UNSPECIFIED']
|
||||||
i += 1
|
i += 1
|
||||||
elif sys.argv[i].lower() == u'states':
|
elif sys.argv[i].lower() == u'states':
|
||||||
states = sys.argv[i+1].split(u',')
|
states = sys.argv[i+1].upper().replace(u',', u' ').split()
|
||||||
i += 2
|
i += 2
|
||||||
elif sys.argv[i].lower() in usergroup_types:
|
elif sys.argv[i].lower() in usergroup_types:
|
||||||
studentIds = getUsersToModify(entity_type=sys.argv[i], entity=sys.argv[i+1])
|
studentIds = getUsersToModify(entity_type=sys.argv[i], entity=sys.argv[i+1])
|
||||||
i += 2
|
i += 2
|
||||||
|
else:
|
||||||
|
print u'ERROR: %s is not a valid argument for "gam print guardians"' % sys.argv[i]
|
||||||
|
sys.exit(2)
|
||||||
n = 1
|
n = 1
|
||||||
for studentId in studentIds:
|
for studentId in studentIds:
|
||||||
kwargs = {u'invitedEmailAddress': invitedEmailAddress, u'studentId': studentId}
|
kwargs = {u'invitedEmailAddress': invitedEmailAddress, u'studentId': studentId}
|
||||||
|
|||||||
Reference in New Issue
Block a user