lepture/flask-oauthlib — pull request #68 by davislx (2014-01-08 16:07:23+00:00)
Title: Branch:dec - adding return statement to all the decorator func

Bug
------
The client/token *getter* and *setters* in oauth provider 1 & 2 makes the original function not callable

Reproduce
-----
Steps:

from . import oauth #the oauth server object
@oauth.grantgetter
def load_request_token(token):
print 'abc'
return 1

if __name__ == '__main__':
load_request_token('cba')

Expectation:
Running the script will print out `abc`

Reality:
Won't be able to call load_request_token

Solution
----
Add `return f` to all the *getter* and *setter* in the providers

Reference
-----
Flask's *getter* decorator also return the f:

@setupmethod
def before_request(self, f):
"""Registers a function to run before each request."""
self.before_request_funcs.setdefault(None, []).append(f)
return f

https://github.com/mitsuhiko/flask/blob/master/flask/app.py#L1194

Test result
----

(flask-oauthlib)davislx@vm-0:~/Github/flask-oauthlib$ nosetests
..................................................................
----------------------------------------------------------------------
Ran 66 tests in 194.731s
OK