We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Fix connecting a GitHub org
I tried connecting the GitHub liberapay org to the [LiberapayOrg](https://liberapay.com/LiberapayOrg/) account but I ended up on the take-over confirmation page asking me to transfer my personal account.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `liberapay/elsewhere/github.py`
Content:
```
1 from __future__ import absolute_import, division, print_function, unicode_literals
2 
3 from liberapay.elsewhere import PlatformOAuth2
4 from liberapay.elsewhere._extractors import key
5 from liberapay.elsewhere._paginators import header_links_paginator
6 
7 
8 class GitHub(PlatformOAuth2):
9 
10     # Platform attributes
11     name = 'github'
12     display_name = 'GitHub'
13     account_url = 'https://github.com/{user_name}'
14     allows_team_connect = True
15 
16     # Auth attributes
17     auth_url = 'https://github.com/login/oauth/authorize'
18     access_token_url = 'https://github.com/login/oauth/access_token'
19     oauth_email_scope = 'user:email'
20     oauth_default_scope = ['read:org']
21 
22     # API attributes
23     api_format = 'json'
24     api_paginator = header_links_paginator()
25     api_url = 'https://api.github.com'
26     api_user_info_path = '/user/{user_id}'
27     api_user_name_info_path = '/users/{user_name}'
28     api_user_self_info_path = '/user'
29     api_team_members_path = '/orgs/{user_name}/public_members'
30     api_friends_path = '/users/{user_name}/following'
31     ratelimit_headers_prefix = 'x-ratelimit-'
32 
33     # User info extractors
34     x_user_id = key('id')
35     x_user_name = key('login')
36     x_display_name = key('name')
37     x_email = key('email')
38     x_gravatar_id = key('gravatar_id')
39     x_avatar_url = key('avatar_url')
40     x_is_team = key('type', clean=lambda t: t.lower() == 'organization')
41 
42     def is_team_admin(self, team_name, sess):
43         user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))
44         return any(team.get('organization', {}).get('login') == team_name and
45                    team.get('permission') == 'admin'
46                    for team in user_teams)
47
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/liberapay/elsewhere/github.py b/liberapay/elsewhere/github.py
--- a/liberapay/elsewhere/github.py
+++ b/liberapay/elsewhere/github.py
@@ -39,8 +39,7 @@
     x_avatar_url = key('avatar_url')
     x_is_team = key('type', clean=lambda t: t.lower() == 'organization')
 
-    def is_team_admin(self, team_name, sess):
-        user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))
-        return any(team.get('organization', {}).get('login') == team_name and
-                   team.get('permission') == 'admin'
-                   for team in user_teams)
+    def is_team_member(self, org_name, sess):
+        org_name = org_name.lower()
+        user_orgs = self.api_parser(self.api_get('/user/orgs', sess=sess))
+        return any(org.get('login') == org_name for org in user_orgs)

{"golden_diff": "diff --git a/liberapay/elsewhere/github.py b/liberapay/elsewhere/github.py\n--- a/liberapay/elsewhere/github.py\n+++ b/liberapay/elsewhere/github.py\n@@ -39,8 +39,7 @@\n     x_avatar_url = key('avatar_url')\n     x_is_team = key('type', clean=lambda t: t.lower() == 'organization')\n \n-    def is_team_admin(self, team_name, sess):\n-        user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))\n-        return any(team.get('organization', {}).get('login') == team_name and\n-                   team.get('permission') == 'admin'\n-                   for team in user_teams)\n+    def is_team_member(self, org_name, sess):\n+        org_name = org_name.lower()\n+        user_orgs = self.api_parser(self.api_get('/user/orgs', sess=sess))\n+        return any(org.get('login') == org_name for org in user_orgs)\n", "issue": "Fix connecting a GitHub org\nI tried connecting the GitHub liberapay org to the [LiberapayOrg](https://liberapay.com/LiberapayOrg/) account but I ended up on the take-over confirmation page asking me to transfer my personal account.\n\n", "before_files": [{"content": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom liberapay.elsewhere import PlatformOAuth2\nfrom liberapay.elsewhere._extractors import key\nfrom liberapay.elsewhere._paginators import header_links_paginator\n\n\nclass GitHub(PlatformOAuth2):\n\n    # Platform attributes\n    name = 'github'\n    display_name = 'GitHub'\n    account_url = 'https://github.com/{user_name}'\n    allows_team_connect = True\n\n    # Auth attributes\n    auth_url = 'https://github.com/login/oauth/authorize'\n    access_token_url = 'https://github.com/login/oauth/access_token'\n    oauth_email_scope = 'user:email'\n    oauth_default_scope = ['read:org']\n\n    # API attributes\n    api_format = 'json'\n    api_paginator = header_links_paginator()\n    api_url = 'https://api.github.com'\n    api_user_info_path = '/user/{user_id}'\n    api_user_name_info_path = '/users/{user_name}'\n    api_user_self_info_path = '/user'\n    api_team_members_path = '/orgs/{user_name}/public_members'\n    api_friends_path = '/users/{user_name}/following'\n    ratelimit_headers_prefix = 'x-ratelimit-'\n\n    # User info extractors\n    x_user_id = key('id')\n    x_user_name = key('login')\n    x_display_name = key('name')\n    x_email = key('email')\n    x_gravatar_id = key('gravatar_id')\n    x_avatar_url = key('avatar_url')\n    x_is_team = key('type', clean=lambda t: t.lower() == 'organization')\n\n    def is_team_admin(self, team_name, sess):\n        user_teams = self.api_parser(self.api_get('/user/teams', sess=sess))\n        return any(team.get('organization', {}).get('login') == team_name and\n                   team.get('permission') == 'admin'\n                   for team in user_teams)\n", "path": "liberapay/elsewhere/github.py"}], "after_files": [{"content": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom liberapay.elsewhere import PlatformOAuth2\nfrom liberapay.elsewhere._extractors import key\nfrom liberapay.elsewhere._paginators import header_links_paginator\n\n\nclass GitHub(PlatformOAuth2):\n\n    # Platform attributes\n    name = 'github'\n    display_name = 'GitHub'\n    account_url = 'https://github.com/{user_name}'\n    allows_team_connect = True\n\n    # Auth attributes\n    auth_url = 'https://github.com/login/oauth/authorize'\n    access_token_url = 'https://github.com/login/oauth/access_token'\n    oauth_email_scope = 'user:email'\n    oauth_default_scope = ['read:org']\n\n    # API attributes\n    api_format = 'json'\n    api_paginator = header_links_paginator()\n    api_url = 'https://api.github.com'\n    api_user_info_path = '/user/{user_id}'\n    api_user_name_info_path = '/users/{user_name}'\n    api_user_self_info_path = '/user'\n    api_team_members_path = '/orgs/{user_name}/public_members'\n    api_friends_path = '/users/{user_name}/following'\n    ratelimit_headers_prefix = 'x-ratelimit-'\n\n    # User info extractors\n    x_user_id = key('id')\n    x_user_name = key('login')\n    x_display_name = key('name')\n    x_email = key('email')\n    x_gravatar_id = key('gravatar_id')\n    x_avatar_url = key('avatar_url')\n    x_is_team = key('type', clean=lambda t: t.lower() == 'organization')\n\n    def is_team_member(self, org_name, sess):\n        org_name = org_name.lower()\n        user_orgs = self.api_parser(self.api_get('/user/orgs', sess=sess))\n        return any(org.get('login') == org_name for org in user_orgs)\n", "path": "liberapay/elsewhere/github.py"}]}