mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-10 06:33:34 +00:00
Handle additional run_batch calls (#344)
This commit is contained in:
21
src/gam.py
21
src/gam.py
@ -1567,9 +1567,9 @@ def doSyncCourseParticipants():
|
|||||||
to_remove = list(set(current_course_users) - set(diff_against_users))
|
to_remove = list(set(current_course_users) - set(diff_against_users))
|
||||||
gam_commands = []
|
gam_commands = []
|
||||||
for add_email in to_add:
|
for add_email in to_add:
|
||||||
gam_commands.append([u'course', courseId, u'add', participant_type, add_email])
|
gam_commands.append([u'gam', u'course', courseId, u'add', participant_type, add_email])
|
||||||
for remove_email in to_remove:
|
for remove_email in to_remove:
|
||||||
gam_commands.append([u'course', courseId, u'remove', participant_type, remove_email])
|
gam_commands.append([u'gam', u'course', courseId, u'remove', participant_type, remove_email])
|
||||||
run_batch(gam_commands)
|
run_batch(gam_commands)
|
||||||
|
|
||||||
def doDelCourseParticipant():
|
def doDelCourseParticipant():
|
||||||
@ -7273,9 +7273,9 @@ def doUpdateGroup():
|
|||||||
sys.stderr.write(u'Need to add %s %s and remove %s.\n' % (len(to_add), role, len(to_remove)))
|
sys.stderr.write(u'Need to add %s %s and remove %s.\n' % (len(to_add), role, len(to_remove)))
|
||||||
items = []
|
items = []
|
||||||
for user_email in to_add:
|
for user_email in to_add:
|
||||||
items.append([u'update', u'group', group, u'add', role, user_email])
|
items.append([u'gam', u'update', u'group', group, u'add', role, user_email])
|
||||||
for user_email in to_remove:
|
for user_email in to_remove:
|
||||||
items.append([u'update', u'group', group, u'remove', user_email])
|
items.append([u'gam', u'update', u'group', group, u'remove', user_email])
|
||||||
run_batch(items)
|
run_batch(items)
|
||||||
elif myarg in [u'delete', u'remove']:
|
elif myarg in [u'delete', u'remove']:
|
||||||
i = 5
|
i = 5
|
||||||
@ -10262,7 +10262,7 @@ def runCmdForUsers(cmd, users, default_to_batch=False, **kwargs):
|
|||||||
if default_to_batch and len(users) > 1:
|
if default_to_batch and len(users) > 1:
|
||||||
items = []
|
items = []
|
||||||
for user in users:
|
for user in users:
|
||||||
items.append([u'user', user] + sys.argv[3:])
|
items.append([u'gam', u'user', user] + sys.argv[3:])
|
||||||
run_batch(items)
|
run_batch(items)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
else:
|
else:
|
||||||
@ -10641,15 +10641,8 @@ def ProcessGAMCommand(args):
|
|||||||
for user in users:
|
for user in users:
|
||||||
print user
|
print user
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
try:
|
if (GC_Values[GC_AUTO_BATCH_MIN] > 0) and (len(users) > GC_Values[GC_AUTO_BATCH_MIN]):
|
||||||
if (GC_Values[GC_AUTO_BATCH_MIN] > 0) and (len(users) > GC_Values[GC_AUTO_BATCH_MIN]):
|
runCmdForUsers(None, users, True)
|
||||||
items = []
|
|
||||||
for user in users:
|
|
||||||
items.append([u'user', user] + sys.argv[3:])
|
|
||||||
run_batch(items)
|
|
||||||
sys.exit(0)
|
|
||||||
except TypeError:
|
|
||||||
pass
|
|
||||||
if command == u'transfer':
|
if command == u'transfer':
|
||||||
transferWhat = sys.argv[4].lower()
|
transferWhat = sys.argv[4].lower()
|
||||||
if transferWhat == u'drive':
|
if transferWhat == u'drive':
|
||||||
|
Reference in New Issue
Block a user