def METHOD_NAME(env, **kwargs):
    """Celery may start handling a submission before it is actually saved
    in the DB. This is a workaround for this.
    """
    for _i in range(WAIT_FOR_SUBMISSION_RETRIES):
        with transaction.atomic():
            if bool(Submission.objects.filter(id=env['submission_id'])):
                break
        time.sleep(WAIT_FOR_SUBMISSION_SLEEP_SECONDS)
    return env