Skip to content

Commit 0a47d7c

Browse files
author
Gabriel Monroy
committed
raise 400 on environment error, as in case of missing credentials
1 parent 86227fa commit 0a47d7c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

api/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def create(self, request, **kwargs):
155155
except IntegrityError:
156156
return Response('Formation with this Id already exists.',
157157
status=HTTP_400_BAD_REQUEST)
158+
except EnvironmentError as e:
159+
return Response(str(e), status=HTTP_400_BAD_REQUEST)
158160

159161
def post_save(self, formation, created=False, **kwargs):
160162
if created:

0 commit comments

Comments
 (0)