Files
edx-platform/lms/djangoapps/courseware/courseware_access_exception.py
Feanil Patel 9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00

26 lines
604 B
Python

"""
This file contains the exception used in courseware access
"""
from django.http import Http404
class CoursewareAccessException(Http404):
"""
Exception for courseware access errors
"""
def __init__(self, access_response):
super(CoursewareAccessException, self).__init__("Course not found.")
self.access_response = access_response
def to_json(self):
"""
Creates a serializable JSON representation of an CoursewareAccessException.
Returns:
dict: JSON representation
"""
return self.access_response.to_json()