[Python-modules-commits] [python-social-auth] 275/322: Allow to remove team from username in slack backend
Wolfgang Borgert
debacle at moszumanska.debian.org
Sat Dec 24 15:13:19 UTC 2016
This is an automated email from the git hooks/post-receive script.
debacle pushed a commit to tag v0.2.10
in repository python-social-auth.
commit 3ae0c281f0e2aabaceea0b85f20fa75bd5c0b42b
Author: Matías Aguirre <matiasaguirre at gmail.com>
Date: Sun Apr 19 04:32:05 2015 -0300
Allow to remove team from username in slack backend
---
social/backends/slack.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/social/backends/slack.py b/social/backends/slack.py
index 74775c8..ac60634 100644
--- a/social/backends/slack.py
+++ b/social/backends/slack.py
@@ -26,8 +26,10 @@ class SlackOAuth2(BaseOAuth2):
"""Return user details from Slack account"""
# Build the username with the team $username@$team_url
# Necessary to get unique names for all of slack
- match = re.search(r'//([^.]+)\.slack\.com', response['url'])
- username = '{0}@{1}'.format(response.get("user"), match.group(1))
+ username = response.get('user')
+ if self.setting('USERNAME_WITH_TEAM', True):
+ match = re.search(r'//([^.]+)\.slack\.com', response['url'])
+ username = '{0}@{1}'.format(username, match.group(1))
out = {'username': username}
if 'profile' in response:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-social-auth.git
More information about the Python-modules-commits
mailing list