Commit 8bf2eb17 by Rocky Duan

middleware file forgot to include

parent 941ae0f0
from comment_client import CommentClientError
from django_comment_client.utils import JsonError
import json
class AjaxExceptionMiddleware(object):
def process_exception(self, request, exception):
if isinstance(exception, CommentClientError) and request.is_ajax():
return JsonError(json.loads(exception.message))
return None
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