We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
When I am logged in, everyone else's communities are the same
They have the same communities. For example, cookiecutter has 3 people in it, (me, audreyr, and sloria), but if I visit kennethreitz or mitsuhiko they also claim to be in it. So do the gittip project maintainers.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `gittip/models/community.py`
Content:
```
1 import re
2 
3 import gittip
4 from postgres.orm import Model
5 
6 
7 name_pattern = re.compile(r'^[A-Za-z0-9,._ -]+$')
8 
9 def slugize(slug):
10     """Convert a string to a string for an URL.
11     """
12     assert name_pattern.match(slug) is not None
13     slug = slug.lower()
14     for c in (' ', ',', '.', '_'):
15         slug = slug.replace(c, '-')
16     while '--' in slug:
17         slug = slug.replace('--', '-')
18     slug = slug.strip('-')
19     return slug
20 
21 
22 def slug_to_name(slug):
23     """Given a slug like ``python``, return a name like ``Python``.
24 
25     :database: One SELECT, one row
26 
27     """
28     SQL = "SELECT name FROM community_summary WHERE slug=%s"
29     return gittip.db.one(SQL, (slug,))
30 
31 
32 def get_list_for(user):
33     """Return a listing of communities.
34 
35     :database: One SELECT, multiple rows
36 
37     """
38     if user is None or user.ANON:
39         member_test = "false"
40         sort_order = 'DESC'
41         params = ()
42     else:
43         member_test = "bool_or(participant = %s)"
44         sort_order = 'ASC'
45         params = (user.participant.username,)
46 
47     return gittip.db.all("""
48 
49         SELECT max(name) AS name
50              , slug
51              , count(*) AS nmembers
52              , {} AS is_member
53           FROM current_communities
54       GROUP BY slug
55       ORDER BY nmembers {}, slug
56 
57     """.format(member_test, sort_order), params)
58 
59 
60 class Community(Model):
61     """Model a community on Gittip.
62     """
63 
64     typname = "community_summary"
65 
66     def check_membership(self, participant):
67         return self.db.one("""
68 
69         SELECT * FROM current_communities WHERE slug=%s AND participant=%s
70 
71         """, (self.slug, participant.username)) is not None
72 
73 
74 def typecast(request):
75     pass
76
```
--- 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/gittip/models/community.py b/gittip/models/community.py
--- a/gittip/models/community.py
+++ b/gittip/models/community.py
@@ -29,20 +29,20 @@
     return gittip.db.one(SQL, (slug,))
 
 
-def get_list_for(user):
+def get_list_for(username):
     """Return a listing of communities.
 
     :database: One SELECT, multiple rows
 
     """
-    if user is None or user.ANON:
+    if username is None:
         member_test = "false"
         sort_order = 'DESC'
         params = ()
     else:
         member_test = "bool_or(participant = %s)"
         sort_order = 'ASC'
-        params = (user.participant.username,)
+        params = (username,)
 
     return gittip.db.all("""

{"golden_diff": "diff --git a/gittip/models/community.py b/gittip/models/community.py\n--- a/gittip/models/community.py\n+++ b/gittip/models/community.py\n@@ -29,20 +29,20 @@\n     return gittip.db.one(SQL, (slug,))\n \n \n-def get_list_for(user):\n+def get_list_for(username):\n     \"\"\"Return a listing of communities.\n \n     :database: One SELECT, multiple rows\n \n     \"\"\"\n-    if user is None or user.ANON:\n+    if username is None:\n         member_test = \"false\"\n         sort_order = 'DESC'\n         params = ()\n     else:\n         member_test = \"bool_or(participant = %s)\"\n         sort_order = 'ASC'\n-        params = (user.participant.username,)\n+        params = (username,)\n \n     return gittip.db.all(\"\"\"\n", "issue": "When I am logged in, everyone else's communities are the same\nThey have the same communities. For example, cookiecutter has 3 people in it, (me, audreyr, and sloria), but if I visit kennethreitz or mitsuhiko they also claim to be in it. So do the gittip project maintainers.\n\n", "before_files": [{"content": "import re\n\nimport gittip\nfrom postgres.orm import Model\n\n\nname_pattern = re.compile(r'^[A-Za-z0-9,._ -]+$')\n\ndef slugize(slug):\n    \"\"\"Convert a string to a string for an URL.\n    \"\"\"\n    assert name_pattern.match(slug) is not None\n    slug = slug.lower()\n    for c in (' ', ',', '.', '_'):\n        slug = slug.replace(c, '-')\n    while '--' in slug:\n        slug = slug.replace('--', '-')\n    slug = slug.strip('-')\n    return slug\n\n\ndef slug_to_name(slug):\n    \"\"\"Given a slug like ``python``, return a name like ``Python``.\n\n    :database: One SELECT, one row\n\n    \"\"\"\n    SQL = \"SELECT name FROM community_summary WHERE slug=%s\"\n    return gittip.db.one(SQL, (slug,))\n\n\ndef get_list_for(user):\n    \"\"\"Return a listing of communities.\n\n    :database: One SELECT, multiple rows\n\n    \"\"\"\n    if user is None or user.ANON:\n        member_test = \"false\"\n        sort_order = 'DESC'\n        params = ()\n    else:\n        member_test = \"bool_or(participant = %s)\"\n        sort_order = 'ASC'\n        params = (user.participant.username,)\n\n    return gittip.db.all(\"\"\"\n\n        SELECT max(name) AS name\n             , slug\n             , count(*) AS nmembers\n             , {} AS is_member\n          FROM current_communities\n      GROUP BY slug\n      ORDER BY nmembers {}, slug\n\n    \"\"\".format(member_test, sort_order), params)\n\n\nclass Community(Model):\n    \"\"\"Model a community on Gittip.\n    \"\"\"\n\n    typname = \"community_summary\"\n\n    def check_membership(self, participant):\n        return self.db.one(\"\"\"\n\n        SELECT * FROM current_communities WHERE slug=%s AND participant=%s\n\n        \"\"\", (self.slug, participant.username)) is not None\n\n\ndef typecast(request):\n    pass\n", "path": "gittip/models/community.py"}], "after_files": [{"content": "import re\n\nimport gittip\nfrom postgres.orm import Model\n\n\nname_pattern = re.compile(r'^[A-Za-z0-9,._ -]+$')\n\ndef slugize(slug):\n    \"\"\"Convert a string to a string for an URL.\n    \"\"\"\n    assert name_pattern.match(slug) is not None\n    slug = slug.lower()\n    for c in (' ', ',', '.', '_'):\n        slug = slug.replace(c, '-')\n    while '--' in slug:\n        slug = slug.replace('--', '-')\n    slug = slug.strip('-')\n    return slug\n\n\ndef slug_to_name(slug):\n    \"\"\"Given a slug like ``python``, return a name like ``Python``.\n\n    :database: One SELECT, one row\n\n    \"\"\"\n    SQL = \"SELECT name FROM community_summary WHERE slug=%s\"\n    return gittip.db.one(SQL, (slug,))\n\n\ndef get_list_for(username):\n    \"\"\"Return a listing of communities.\n\n    :database: One SELECT, multiple rows\n\n    \"\"\"\n    if username is None:\n        member_test = \"false\"\n        sort_order = 'DESC'\n        params = ()\n    else:\n        member_test = \"bool_or(participant = %s)\"\n        sort_order = 'ASC'\n        params = (username,)\n\n    return gittip.db.all(\"\"\"\n\n        SELECT max(name) AS name\n             , slug\n             , count(*) AS nmembers\n             , {} AS is_member\n          FROM current_communities\n      GROUP BY slug\n      ORDER BY nmembers {}, slug\n\n    \"\"\".format(member_test, sort_order), params)\n\n\nclass Community(Model):\n    \"\"\"Model a community on Gittip.\n    \"\"\"\n\n    typname = \"community_summary\"\n\n    def check_membership(self, participant):\n        return self.db.one(\"\"\"\n\n        SELECT * FROM current_communities WHERE slug=%s AND participant=%s\n\n        \"\"\", (self.slug, participant.username)) is not None\n\n\ndef typecast(request):\n    pass\n", "path": "gittip/models/community.py"}]}