Skip to content

Commit

Permalink
Use str to get the exception message (#3912)
Browse files Browse the repository at this point in the history
* Use str to get the exception message

* Remove import

* Isort
  • Loading branch information
stsewd authored and agjohnson committed Sep 6, 2018
1 parent 09ef90f commit d704631
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit d704631

Please sign in to comment.