From: Stas Kravets Date: Tue, 25 Jan 2011 09:14:27 +0000 (+0300) Subject: Updated LJ and Yandex backends to work with self.data, not self.POST. X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c55b8229574e8bf8228727688e6193042c4a0b86;p=django-social-auth.git Updated LJ and Yandex backends to work with self.data, not self.POST. --- diff --git a/social_auth/backends/contrib/livejournal.py b/social_auth/backends/contrib/livejournal.py index 1b1b18d..8629c59 100644 --- a/social_auth/backends/contrib/livejournal.py +++ b/social_auth/backends/contrib/livejournal.py @@ -37,10 +37,9 @@ class LiveJournalAuth(OpenIdAuth): def openid_url(self): """Returns LiveJournal authentication URL""" - if self.request.method != 'POST' or \ - not self.request.POST.get(LIVEJOURNAL_USER_FIELD): + if LIVEJOURNAL_USER_FIELD not in self.data: raise ValueError, 'Missing LiveJournal user identifier' - return LIVEJOURNAL_URL % self.request.POST[LIVEJOURNAL_USER_FIELD] + return LIVEJOURNAL_URL % self.data[LIVEJOURNAL_USER_FIELD] # Backend definition diff --git a/social_auth/backends/contrib/yandex.py b/social_auth/backends/contrib/yandex.py index 39b5b1d..ecccaa5 100644 --- a/social_auth/backends/contrib/yandex.py +++ b/social_auth/backends/contrib/yandex.py @@ -35,10 +35,9 @@ class YandexAuth(OpenIdAuth): def openid_url(self): """Returns Yandex authentication URL""" - if self.request.method != 'POST' or \ - not self.request.POST.get(YANDEX_USER_FIELD): + if YANDEX_USER_FIELD not in self.data: raise ValueError, 'Missing Yandex user identifier' - return YANDEX_URL % self.request.POST[YANDEX_USER_FIELD] + return YANDEX_URL % self.data[YANDEX_USER_FIELD] # Backend definition BACKENDS = {