Now checks for code 202 when checking for success for other operations.
Task: 41574 Story: 2008505 Change-Id: I58ea7dc0aae66a38a00ed68e6c6b2cd9a4cbd32b
This commit is contained in:
parent
bb92841b5b
commit
104c474479
@ -44,7 +44,7 @@ class AcknowlegeNotifcation(tables.BatchAction):
|
||||
|
||||
def action(self, request, obj_id):
|
||||
result = adjutant.notifications_acknowlege(request, obj_id)
|
||||
if not result or result.status_code != 200:
|
||||
if not result or result.status_code not in [200, 202]:
|
||||
exception = exceptions.NotAvailable()
|
||||
exception._safe_message = False
|
||||
raise exception
|
||||
|
@ -77,7 +77,7 @@ class CancelQuotaTask(tables.DeleteAction):
|
||||
|
||||
def delete(self, request, obj_id):
|
||||
result = adjutant.task_cancel(request, obj_id)
|
||||
if not result or result.status_code != 200:
|
||||
if not result or result.status_code not in [200, 202]:
|
||||
exception = exceptions.NotAvailable()
|
||||
exception._safe_message = False
|
||||
raise exception
|
||||
|
@ -43,7 +43,7 @@ class UpdateTaskForm(forms.SelfHandlingForm):
|
||||
try:
|
||||
response = adjutant.task_update(
|
||||
request, task_id, data['task_data'])
|
||||
if response.status_code == 200:
|
||||
if response.status_code in [200, 202]:
|
||||
messages.success(request, _('Updated task successfully.'))
|
||||
elif response.status_code == 400:
|
||||
messages.error(request, _(response.text))
|
||||
|
@ -42,7 +42,7 @@ class CancelTask(tables.DeleteAction):
|
||||
|
||||
def delete(self, request, obj_id):
|
||||
result = adjutant.task_cancel(request, obj_id)
|
||||
if not result or result.status_code != 200:
|
||||
if not result or result.status_code not in [200, 202]:
|
||||
exception = exceptions.NotAvailable()
|
||||
exception._safe_message = False
|
||||
raise exception
|
||||
@ -111,7 +111,7 @@ class ReissueToken(tables.BatchAction):
|
||||
|
||||
def action(self, request, obj_id):
|
||||
result = adjutant.token_reissue(request, obj_id)
|
||||
if not result or result.status_code != 200:
|
||||
if not result or result.status_code not in [200, 202]:
|
||||
exception = exceptions.NotAvailable()
|
||||
exception._safe_message = False
|
||||
raise exception
|
||||
@ -144,7 +144,7 @@ class RevalidateTask(tables.BatchAction):
|
||||
|
||||
def action(self, request, obj_id):
|
||||
result = adjutant.task_revalidate(request, obj_id)
|
||||
if not result or result.status_code != 200:
|
||||
if not result or result.status_code not in [200, 202]:
|
||||
exception = exceptions.NotAvailable()
|
||||
exception._safe_message = False
|
||||
raise exception
|
||||
|
Loading…
x
Reference in New Issue
Block a user