Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Login and Logout actions are performed via POST now with CSRF protection activated
- Loading branch information
Showing
7 changed files
with
104 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import odesk | ||
|
||
|
||
def get_odesk_client(request, **attrs): | ||
"""Construct an oDesk client. | ||
*Parameters:* | ||
:attrs: keyword arguments that will be | ||
attached to the ``client.auth`` as attributes | ||
(``request_token``, etc.) | ||
""" | ||
client_kwargs = { | ||
'oauth_access_token': attrs.pop('oauth_access_token', None), | ||
'oauth_access_token_secret': attrs.pop( | ||
'oauth_access_token_secret', None) | ||
|
||
} | ||
|
||
settings = request.registry.settings | ||
client = odesk.Client(settings['odesk.api.key'], | ||
settings['odesk.api.secret'], **client_kwargs) | ||
|
||
for key, value in attrs.items(): | ||
setattr(client.auth, key, value) | ||
|
||
return client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters