Example #1
0
 def post():
     from api.tasks import twitter_verify
     username = request.form.get('username')
     code = get_verify_code()
     twitter_verify.apply_async(kwargs=({"code": code["code"],
                                         "username": username}),
                                countdown=5)
     return Response(json.dumps({"text": VERIFY.format(code["code"])}, default=json_serial), status=200, mimetype="application/json")
Example #2
0
    def post():
        username = request.form.get("username")
        service = request.form.get("service")
        p = PublicId.get(idtype=service, account=username).refresh_code()

        twitter_verify.apply_async(kwargs=({"code": p.code, "username": username}), countdown=5)
        return Response(
            json.dumps({"text": VERIFY.format(p.code)}, default=json_serial), status=200, mimetype="application/json"
        )