Skip to content

Commit 360b1ed

Browse files
author
Matthew Fisher
committed
ref(controller): move response into try block
1 parent 17d591c commit 360b1ed

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

controller/api/views.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,11 @@ def scale(self, request, **kwargs):
150150
def logs(self, request, **kwargs):
151151
app = self.get_object()
152152
try:
153-
logs = app.logs()
153+
return Response(app.logs(), status=status.HTTP_200_OK, content_type='text/plain')
154154
except EnvironmentError:
155155
return Response("No logs for {}".format(app.id),
156156
status=status.HTTP_204_NO_CONTENT,
157157
content_type='text/plain')
158-
return Response(logs, status=status.HTTP_200_OK,
159-
content_type='text/plain')
160158

161159
def run(self, request, **kwargs):
162160
app = self.get_object()

0 commit comments

Comments
 (0)