mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Long-running async tasks: Expose running state
This commit is contained in:
@@ -77,7 +77,8 @@ class AsyncAction:
|
||||
data = self._ajax_response_data()
|
||||
data.update({
|
||||
'async_id': res.id,
|
||||
'ready': ready
|
||||
'ready': ready,
|
||||
'started': False,
|
||||
})
|
||||
if ready:
|
||||
if res.successful() and not isinstance(res.info, Exception):
|
||||
@@ -102,8 +103,13 @@ class AsyncAction:
|
||||
})
|
||||
elif res.state == 'PROGRESS':
|
||||
data.update({
|
||||
'started': True,
|
||||
'percentage': res.result.get('value', 0)
|
||||
})
|
||||
elif res.state == 'STARTED':
|
||||
data.update({
|
||||
'started': True,
|
||||
})
|
||||
return data
|
||||
|
||||
def get_result(self, request):
|
||||
|
||||
Reference in New Issue
Block a user