adds button to stop job
This commit is contained in:
parent
7a36de5ebe
commit
6792b3d7b8
4 changed files with 16 additions and 4 deletions
|
@ -74,7 +74,7 @@ from .shelf.shelf_actions import shelve, unshelve
|
|||
|
||||
# csv import
|
||||
from .imports.import_data import Import
|
||||
from .imports.import_status import ImportStatus, retry_item
|
||||
from .imports.import_status import ImportStatus, retry_item, stop_import
|
||||
from .imports.troubleshoot import ImportTroubleshoot
|
||||
from .imports.manually_review import (
|
||||
ImportManualReview,
|
||||
|
|
|
@ -78,8 +78,8 @@ def retry_item(request, job_id, item_id):
|
|||
|
||||
@login_required
|
||||
@require_POST
|
||||
def cancel_import(request, job_id):
|
||||
def stop_import(request, job_id):
|
||||
"""scrap that"""
|
||||
job = get_object_or_404(models.ImportJob, id=job_id, job__user=request.user)
|
||||
job.stop()
|
||||
job = get_object_or_404(models.ImportJob, id=job_id, user=request.user)
|
||||
job.stop_job()
|
||||
return redirect("import-status", job_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue