How to use the klein.Field.text function in klein

To help you get started, we’ve selected a few klein examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github twisted / klein / loginspike.py View on Github external
    username=Field.text(),
    email=Field.text(),
    password=Field.password(),
)
@inlineCallbacks
def doSignup(username, email, password, binding):
    # type: (str, str, str, ISimpleAccountBinding) -> Deferred
    acct = yield binding.createAccount(username, email, password)
    result = {
        "signupActive": "active",
        "accountID": None
    }
    if acct is None:
        result.update({
            "success": "Account creation failed!",
            "link_message": "try again",
            "next_url": "/signup",
github twisted / klein / loginspike.py View on Github external
    email=Field.text(),
    password=Field.password(),
)
@inlineCallbacks
def doSignup(username, email, password, binding):
    # type: (str, str, str, ISimpleAccountBinding) -> Deferred
    acct = yield binding.createAccount(username, email, password)
    result = {
        "signupActive": "active",
        "accountID": None
    }
    if acct is None:
        result.update({
            "success": "Account creation failed!",
            "link_message": "try again",
            "next_url": "/signup",
        })