Deal with NoneType access.
The `NoneType` object is not available from the `types` module in python 3. This is a workaronud to deal with that.
This commit is contained in:
@@ -6,7 +6,6 @@ Module for checking permissions with the comment_client backend
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
from types import NoneType
|
||||
|
||||
import six
|
||||
from edx_django_utils.cache import DEFAULT_REQUEST_CACHE
|
||||
@@ -23,7 +22,7 @@ from openedx.core.lib.cache_utils import request_cached
|
||||
|
||||
|
||||
def has_permission(user, permission, course_id=None):
|
||||
assert isinstance(course_id, (NoneType, CourseKey))
|
||||
assert isinstance(course_id, (type(None), CourseKey))
|
||||
request_cache_dict = DEFAULT_REQUEST_CACHE.data
|
||||
cache_key = "django_comment_client.permissions.has_permission.all_permissions.{}.{}".format(
|
||||
user.id, course_id
|
||||
|
||||
Reference in New Issue
Block a user