Skip to content

Commit

Permalink
Return response on update_status in all cases
Browse files Browse the repository at this point in the history
Always return a reply when update/status is queried.
  • Loading branch information
grisu48 committed Nov 30, 2023
1 parent eca9f33 commit 6383215
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ocw/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ def update(request):


def update_status(request):
if 'application/json' in request.META.get('HTTP_ACCEPT'):
return JsonResponse({
'status': 'running' if db.is_updating() else 'idle',
'last_update': db.last_update()
})

return redirect('instances')
return JsonResponse({
'status': 'running' if db.is_updating() else 'idle',
'last_update': db.last_update()
})


@login_required
Expand Down

0 comments on commit 6383215

Please sign in to comment.