Private
Public Access
1
0

passing all tests on py3

This commit is contained in:
Sander Roosendaal
2019-02-28 22:52:59 +01:00
parent ee4fa4c3b8
commit faeea73b0a
14 changed files with 76 additions and 21 deletions

View File

@@ -28,6 +28,9 @@ import isodate
import re
import cgi
from icalendar import Calendar, Event
from functools import reduce
import rowers.braintreestuff as braintreestuff
import rowers.payments as payments
from rowers.opaque import encoder
@@ -502,7 +505,7 @@ def remove_asynctask(request,id):
def get_job_result(jobid):
if settings.TESTING:
return None
elif settings.DEBUG:
elif settings.CELERY:
result = celery_result.AsyncResult(jobid).result
else:
running_job_ids = rq_registry.get_job_ids()
@@ -541,7 +544,7 @@ def get_job_status(jobid):
'started_at':None,
}
return summary
elif settings.DEBUG:
elif settings.CELERY:
job = celery_result.AsyncResult(jobid)
jobresult = job.result
@@ -592,7 +595,7 @@ def get_job_status(jobid):
return summary
def kill_async_job(request,id='aap'):
if settings.DEBUG:
if settings.CELERY:
job = celery_result.AsyncResult(id)
job.revoke()
else:
@@ -734,7 +737,7 @@ def get_stored_tasks_status(request):
if finished:
cache.set(id,100)
progress = 100
elif cached_progress>0:
elif cached_progress is not None and cached_progress>0:
progress = cached_progress
else:
progress = 0