Commit ca75d4ee by Michael LoTurco Committed by Troy Sankey

started development for seed_rocket_chat

parent 33e59e66
......@@ -1296,6 +1296,8 @@ def advanced_settings_handler(request, course_key_string):
# now update mongo
modulestore().update_item(course_module, request.user.id)
seed_rocket_chat(course_key_string)
return JsonResponse(updated_data)
else:
return JsonResponseBadRequest(errors)
......@@ -1307,6 +1309,23 @@ def advanced_settings_handler(request, course_key_string):
content_type="text/plain"
)
def seed_rocket_chat(course_key):
master_username = 'apiuser'
master_password = 'apipassword'
rocket_url = 'https://hackachattest-chat.sandbox.edx.org'
rocketWrap = RocketWrap(master_username, master_password, server_url=rocket_url, ssl_verify=False)
newgroup = rocketWrap.create_new_group(course_key)
# course_staff = [] # get_course_staff(course_key) #not a real call, this is pseudo
# for user in course_staff:
# rocketWrap.create_user(user.email, user.name, user.password, user.username)
# rocket.add_staff_users_to_group_as_admin(course_staff) #TODO: right this function
description = "test" # get_short_description(course_key) #not a real call this is pseudo
rocket.set_topic(newgroup.name, description)
class TextbookValidationError(Exception):
"An error thrown when a textbook input is invalid"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment