-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Activate rocketchat using other_course_settings - include create user in create token - docstrings - improve code - Add docstrings
- Loading branch information
1 parent
54e352b
commit a7c8507
Showing
31 changed files
with
406 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
############################################### | ||
# | ||
# Openedx Rocketchat commands. | ||
# | ||
############################################### | ||
|
||
.DEFAULT_GOAL := help | ||
|
||
help: ## display this help message | ||
@echo "Please use \`make <target>' where <target> is one of" | ||
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | sort | awk -F ':.*?## ' 'NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' | ||
|
||
clean: ## delete most git-ignored files | ||
find . -name '__pycache__' -exec rm -rf {} + | ||
find . -name '*.pyc' -exec rm -f {} + | ||
|
||
requirements: ## install environment requirements | ||
pip install -r requirements.txt | ||
|
||
run-quality-test: clean ## Run quality test. | ||
pycodestyle ./openedx_rocketchat | ||
pylint ./openedx_rocketchat --rcfile=./setup.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,27 @@ | ||
""" RocketChat Serializers """ | ||
from rest_framework import serializers | ||
|
||
|
||
# pylint: disable=abstract-method | ||
class RocketChatCredentialsSerializer(serializers.Serializer): | ||
""" | ||
Serializer for RocketChatCredentials view. | ||
""" | ||
url_service = serializers.CharField() | ||
auth_token = serializers.CharField() | ||
user_id = serializers.CharField() | ||
room_ids = serializers.ListField(child=serializers.CharField()) | ||
|
||
|
||
class RocketChatSubscriptionsIdSerializer(serializers.Serializer): | ||
""" | ||
Serializer for RocketChatSubscriptionsId view. | ||
""" | ||
subscriptions_id = serializers.ListField(child=serializers.CharField()) | ||
|
||
|
||
class RocketChatChangeRoleSerializer(serializers.Serializer): | ||
""" | ||
Serializer for RocketChatChangeRole view. | ||
""" | ||
username = serializers.CharField() | ||
role = serializers.CharField() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
openedx_rocketchat/edxapp_wrapper/backends/edxmako_rocketchat_module.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
""" Backend abstraction """ | ||
import os | ||
|
||
import edxmako # pylint: disable=import-error | ||
import openedx_rocketchat | ||
|
||
|
10 changes: 4 additions & 6 deletions
10
openedx_rocketchat/edxapp_wrapper/backends/get_courseware.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
""" Backend abstraction """ | ||
from courseware.access import has_access | ||
from courseware.courses import get_course_with_access | ||
from courseware.access import has_access # pylint: disable=import-error | ||
from courseware.courses import get_course_with_access # pylint: disable=import-error | ||
|
||
|
||
def get_has_access(*args, **kwargs): | ||
""" | ||
""" | ||
""" Backend to has_access """ | ||
return has_access(*args, **kwargs) | ||
|
||
|
||
def course_with_access(*args, **kwargs): | ||
""" | ||
""" | ||
""" Backend to get_course_with_acces """ | ||
return get_course_with_access(*args, **kwargs) |
8 changes: 0 additions & 8 deletions
8
openedx_rocketchat/edxapp_wrapper/backends/get_opaque_keys.py
This file was deleted.
Oops, something went wrong.
21 changes: 11 additions & 10 deletions
21
openedx_rocketchat/edxapp_wrapper/backends/get_student_models.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
""" Backend abstraction """ | ||
from student.models import CourseEnrollment, CourseEnrollmentManager, anonymous_id_for_user, get_user | ||
from student.models import ( # pylint: disable=import-error | ||
CourseEnrollment, | ||
CourseEnrollmentManager, | ||
anonymous_id_for_user, | ||
get_user | ||
) | ||
|
||
|
||
def get_course_enrollment(): | ||
""" | ||
""" | ||
""" Backend to CourseEnrollment """ | ||
return CourseEnrollment | ||
|
||
|
||
def get_course_enrollment_manager(): | ||
""" | ||
""" | ||
""" Backend to CourseEnrollmentManager """ | ||
return CourseEnrollmentManager | ||
|
||
|
||
def get_anonymous_id_for_edxapp_user(*args, **kwargs): | ||
""" | ||
""" | ||
def get_anonymous_id_for_edxapp_user(*args, **kwargs): # pylint: disable=invalid-name | ||
""" Backend to get anonymous_id_for_user """ | ||
return anonymous_id_for_user(*args, **kwargs) | ||
|
||
|
||
def get_edxapp_user(*args, **kwargs): | ||
""" | ||
""" | ||
""" Backend to get_user """ | ||
return get_user(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.