Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use str to get the exception message #3912

Merged
merged 3 commits into from
Sep 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions readthedocs/restapi/views/model_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
import logging

from allauth.socialaccount.models import SocialAccount
from builtins import str
from django.shortcuts import get_object_or_404
from rest_framework import decorators, permissions, status, viewsets
from django.template.loader import render_to_string
from rest_framework import decorators, permissions, status, viewsets
from rest_framework.decorators import detail_route
from rest_framework.renderers import BaseRenderer, JSONRenderer
from rest_framework.response import Response
Expand Down Expand Up @@ -197,7 +198,7 @@ def sync_versions(self, request, **kwargs): # noqa: D205
log.exception('Sync Versions Error')
return Response(
{
'error': e.message,
'error': str(e),
},
status=status.HTTP_400_BAD_REQUEST,
)
Expand Down