django-import-export-extensions icon indicating copy to clipboard operation
django-import-export-extensions copied to clipboard

Could not Cancel ImportJob

Open AndyGreenwell94 opened this issue 2 years ago • 1 comments

After unsuccessful import I got ImportJob status of Parse error, so both cancel action in Django Admin and cancel API endpoint result in following error message:

ImportJob with id 9 has incorrect status: `PARSE_ERROR`. Expected statuses: ['CREATED', 'PARSING', 'CONFIRMED', 'IMPORTING']

I think it's logical to allow deleting failed jobs. Also, it's impossible to delete Parsed jobs as well, which, I believe, should also be possible.

AndyGreenwell94 avatar Oct 11 '23 04:10 AndyGreenwell94

Hi! Thanks for you report. Cancel action is used to stop working job and change it status to CANCELED. As I see you try to cancel job which has PARSE_ERROR status, this status means that job failed at parse step and it not working at background anymore, so you can't cancel it. If you want to delete import job you can extend default ImportJobViewSet with DestroyModelMixin

yalef avatar Mar 11 '24 11:03 yalef