def check_and_upload(support_upload_pk, auth_task, gen_task): auth = AsyncResult(auth_task) gen_csa = AsyncResult(gen_task) if not (auth.ready() and gen_csa.ready()): check_and_upload.retry(countdown=1) elif auth.status == "SUCCESS" and gen_csa.status == "SUCCESS": if auth.result: upload_to_support(support_upload_pk) else: return