예제 #1
0
def result(key):
    print(key)
    result = BaseAsyncResult(key, app=tasks.celery)

    if result.ready():
        return render_template('result.html', result=result.get())
    elif result.failed():
        return result.traceback
    else:
        return render_template('processing.html')
예제 #2
0
def result(key):
    print(key)
    result = BaseAsyncResult(key, app=tasks.celery)

    if result.ready():
        return render_template('result.html', result=result.get())
    elif result.failed():
        return result.traceback
    else:
        return render_template('processing.html')
예제 #3
0
def ajax_account_creation_done(request, task_id):
    result = BaseAsyncResult(task_id, CacheBackend(default_app))

    if not result.ready():
        return {"ok": True, "ready": False}

    result = result.get()

    return {
        "ok":
        True,
        "ready":
        True,
        "slug":
        result['slug'],
        "mt4_id":
        result['mt4_id'],
        "mt4_password":
        result['mt4_password'],
        "redirect":
        reverse("mt4_account_welcome", args=[result['slug'],
                                             result['mt4_id']]),
    }