Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed problem when get_password decorator destroys function it decorates #4

Merged
merged 1 commit into from
Mar 13, 2014

Conversation

ntrifunovic
Copy link
Contributor

Code below wont work without this fix,
because decorator returns None

users = {
    "admin": "admin"
}
@auth.get_password
def get_pw(username):
    if username in users:
        return users[username]
    return None

get_pw("admin")

miguelgrinberg added a commit that referenced this pull request Mar 13, 2014
Fixed problem when get_password decorator destroys function it decorates
@miguelgrinberg miguelgrinberg merged commit f1de169 into miguelgrinberg:master Mar 13, 2014
@miguelgrinberg
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants