Skip to content

Commit

Permalink
Merge pull request #10 from eduNEXT/and/name_course_channel
Browse files Browse the repository at this point in the history
And/name course channel
  • Loading branch information
andrey-canon authored Apr 13, 2018
2 parents 0f0952e + b9afa2b commit 60d6a7a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rocketc/rocketc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
TO-DO: Write a description of what this XBlock is.
"""
import hashlib
import re
import pkg_resources
import requests

Expand Down Expand Up @@ -45,7 +46,6 @@ class RocketChatXBlock(XBlock, XBlockWithSettingsMixin):

salt = "HarryPotter_and_thePrisoner_of _Azkaban"


def resource_string(self, path):
"""Handy helper for getting resources from our kit."""
# pylint: disable=no-self-use
Expand Down Expand Up @@ -130,7 +130,7 @@ def admin_data(self):
data = {"user": user, "password": password}
headers = {"Content-type": "application/json"}
response = requests.post(url=url, json=data, headers=headers)
admin_data = {} # pylint: disable=attribute-defined-outside-init
admin_data = {}
admin_data["auth_token"] = response.json()["data"]["authToken"]
admin_data["user_id"] = response.json()["data"]["userId"]

Expand All @@ -156,11 +156,11 @@ def user_data(self):
user_data = {}
user_data["email"] = user.emails[0]
user_data["role"] = runtime.get_user_role()
user_data["course"] = runtime.course_id.course
user_data["course"] = re.sub('[^A-Za-z0-9]+', '', runtime.course_id._to_string()) # pylint: disable=protected-access
user_data["username"] = user.opt_attrs['edx-platform.username']
user_data["anonymous_student_id"] = runtime.anonymous_student_id
user_data["default_group"] = self.default_channel
return user_data # pylint: disable=attribute-defined-outside-init
return user_data

@property
def server_data(self):
Expand Down

0 comments on commit 60d6a7a

Please sign in to comment.