From 81179bd8755df1361d2d0fe219df26308dafa951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Kr=C3=B6ner?= Date: Tue, 16 Sep 2014 11:59:28 +0200 Subject: [PATCH] Allow more Trello settings --- docs/backends/trello.rst | 10 ++++++++++ social/backends/trello.py | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/docs/backends/trello.rst b/docs/backends/trello.rst index 983149b16..4b55f9931 100644 --- a/docs/backends/trello.rst +++ b/docs/backends/trello.rst @@ -12,5 +12,15 @@ In order to enable it, follow: SOCIAL_AUTH_TRELLO_KEY = '...' SOCIAL_AUTH_TRELLO_SECRET = '...' +There are also two optional settings: + +- your app name, otherwise the authorization page will say "Let An unknown application use your account?":: + + SOCIAL_AUTH_TRELLO_APP_NAME = 'My App' + +- the expiration period, social auth defaults to 'never', but you can change it:: + + SOCIAL_AUTH_TRELLO_EXPIRATION = '30days' + .. _Trello Developers API Keys: https://trello.com/1/appKey/generate diff --git a/social/backends/trello.py b/social/backends/trello.py index 73eaa916d..f07cc4530 100644 --- a/social/backends/trello.py +++ b/social/backends/trello.py @@ -38,3 +38,10 @@ def user_data(self, access_token): return self.get_json(url, auth=self.oauth_auth(access_token)) except ValueError: return None + + def auth_extra_arguments(self): + return { + 'name': self.setting('APP_NAME', ''), + # trello default expiration is '30days' + 'expiration': self.setting('EXPIRATION', 'never') + }