From 63832151d96e24bd4716462adc23f7041363ba5f Mon Sep 17 00:00:00 2001 From: phoenix Date: Thu, 30 Nov 2023 16:28:38 +0100 Subject: [PATCH] Return response on update_status in all cases Always return a reply when update/status is queried. --- ocw/views.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ocw/views.py b/ocw/views.py index a56d8ebd..1e4559f1 100644 --- a/ocw/views.py +++ b/ocw/views.py @@ -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