We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Linking accounts with an OpenStreetMap account does not work if confirmation is required.
Log in with OpenStreetMap account and log out.
Log in with GitHub account and link it with the previous OpenStreetMap account.

Before #1857 works, but not after commit f963d20321e368de89f892b33ea4bce829ebc59d

```
Internal server error, program!

Traceback (most recent call last):
  File "/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/algorithm.py", line 288, in run
    new_state = function(**deps.as_kwargs)
  File "/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/aspen/algorithms/website.py", line 88, in get_response_for_resource
    return {'response': resource.respond(request)}
  File "/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/aspen/resources/dynamic_resource.py", line 52, in respond
    exec self.pages[1] in context
  File "/home/sim6/www.gittip.com/www/on/openstreetmap/associate.spt", line 97, in 
    raise request.resource.respond(request)
  File "/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/aspen/resources/dynamic_resource.py", line 52, in respond
    exec self.pages[1] in context
  File "/home/sim6/www.gittip.com/www/on/confirm.html.spt", line 45, in 
    username = account.get_user_name()
AttributeError: 'OpenStreetMapAccount' object has no attribute 'get_user_name'
```


--- 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/elsewhere/openstreetmap.py`
Content:
```
1 import logging
2 
3 import gittip
4 import requests
5 from aspen import json, log, Response
6 from aspen.http.request import PathPart
7 from aspen.utils import typecheck
8 from gittip.elsewhere import AccountElsewhere
9 
10 
11 
12 class OpenStreetMapAccount(AccountElsewhere):
13     platform = u'openstreetmap'
14 
15     def get_url(self):
16         return self.user_info['html_url']
17 
18 
19 def oauth_url(website, action, then=""):
20     """Return a URL to start oauth dancing with OpenStreetMap.
21 
22     For GitHub we can pass action and then through a querystring. For OpenStreetMap
23     we can't, so we send people through a local URL first where we stash this
24     info in an in-memory cache (eep! needs refactoring to scale).
25 
26     Not sure why website is here. Vestige from GitHub forebear?
27 
28     """
29     then = then.encode('base64').strip()
30     return "/on/openstreetmap/redirect?action=%s&then=%s" % (action, then)
31 
32 
33 def get_user_info(db, username, osm_api_url):
34     """Get the given user's information from the DB or failing that, openstreetmap.
35 
36     :param username:
37         A unicode string representing a username in OpenStreetMap.
38 
39     :param osm_api_url:
40 	URL of OpenStreetMap API.
41 
42     :returns:
43         A dictionary containing OpenStreetMap specific information for the user.
44     """
45     typecheck(username, (unicode, PathPart))
46     rec = db.one("""
47         SELECT user_info FROM elsewhere
48         WHERE platform='openstreetmap'
49         AND user_info->'username' = %s
50     """, (username,))
51     if rec is not None:
52         user_info = rec
53     else:
54         osm_user = requests.get("%s/user/%s" % (osm_api_url, username))
55         if osm_user.status_code == 200:
56             log("User %s found in OpenStreetMap but not in gittip." % username)
57             user_info = None
58         elif osm_user.status_code == 404:
59             raise Response(404,
60                            "OpenStreetMap identity '{0}' not found.".format(username))
61         else:
62             log("OpenStreetMap api responded with {0}: {1}".format(status, content),
63                 level=logging.WARNING)
64             raise Response(502, "OpenStreetMap lookup failed with %d." % status)
65 
66     return user_info
67
```
--- 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/elsewhere/openstreetmap.py b/gittip/elsewhere/openstreetmap.py
--- a/gittip/elsewhere/openstreetmap.py
+++ b/gittip/elsewhere/openstreetmap.py
@@ -15,6 +15,12 @@
     def get_url(self):
         return self.user_info['html_url']
 
+    def get_user_name(self):
+        return self.user_info['username']
+
+    def get_platform_icon(self):
+        return "/assets/icons/openstreetmap.12.png"
+
 
 def oauth_url(website, action, then=""):
     """Return a URL to start oauth dancing with OpenStreetMap.

{"golden_diff": "diff --git a/gittip/elsewhere/openstreetmap.py b/gittip/elsewhere/openstreetmap.py\n--- a/gittip/elsewhere/openstreetmap.py\n+++ b/gittip/elsewhere/openstreetmap.py\n@@ -15,6 +15,12 @@\n     def get_url(self):\n         return self.user_info['html_url']\n \n+    def get_user_name(self):\n+        return self.user_info['username']\n+\n+    def get_platform_icon(self):\n+        return \"/assets/icons/openstreetmap.12.png\"\n+\n \n def oauth_url(website, action, then=\"\"):\n     \"\"\"Return a URL to start oauth dancing with OpenStreetMap.\n", "issue": "Linking accounts with an OpenStreetMap account does not work if confirmation is required.\nLog in with OpenStreetMap account and log out.\nLog in with GitHub account and link it with the previous OpenStreetMap account.\n\nBefore #1857 works, but not after commit f963d20321e368de89f892b33ea4bce829ebc59d\n\n```\nInternal server error, program!\n\nTraceback (most recent call last):\n  File \"/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/algorithm.py\", line 288, in run\n    new_state = function(**deps.as_kwargs)\n  File \"/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/aspen/algorithms/website.py\", line 88, in get_response_for_resource\n    return {'response': resource.respond(request)}\n  File \"/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/aspen/resources/dynamic_resource.py\", line 52, in respond\n    exec self.pages[1] in context\n  File \"/home/sim6/www.gittip.com/www/on/openstreetmap/associate.spt\", line 97, in \n    raise request.resource.respond(request)\n  File \"/home/sim6/www.gittip.com/env/local/lib/python2.7/site-packages/aspen/resources/dynamic_resource.py\", line 52, in respond\n    exec self.pages[1] in context\n  File \"/home/sim6/www.gittip.com/www/on/confirm.html.spt\", line 45, in \n    username = account.get_user_name()\nAttributeError: 'OpenStreetMapAccount' object has no attribute 'get_user_name'\n```\n\n", "before_files": [{"content": "import logging\n\nimport gittip\nimport requests\nfrom aspen import json, log, Response\nfrom aspen.http.request import PathPart\nfrom aspen.utils import typecheck\nfrom gittip.elsewhere import AccountElsewhere\n\n\n\nclass OpenStreetMapAccount(AccountElsewhere):\n    platform = u'openstreetmap'\n\n    def get_url(self):\n        return self.user_info['html_url']\n\n\ndef oauth_url(website, action, then=\"\"):\n    \"\"\"Return a URL to start oauth dancing with OpenStreetMap.\n\n    For GitHub we can pass action and then through a querystring. For OpenStreetMap\n    we can't, so we send people through a local URL first where we stash this\n    info in an in-memory cache (eep! needs refactoring to scale).\n\n    Not sure why website is here. Vestige from GitHub forebear?\n\n    \"\"\"\n    then = then.encode('base64').strip()\n    return \"/on/openstreetmap/redirect?action=%s&then=%s\" % (action, then)\n\n\ndef get_user_info(db, username, osm_api_url):\n    \"\"\"Get the given user's information from the DB or failing that, openstreetmap.\n\n    :param username:\n        A unicode string representing a username in OpenStreetMap.\n\n    :param osm_api_url:\n\tURL of OpenStreetMap API.\n\n    :returns:\n        A dictionary containing OpenStreetMap specific information for the user.\n    \"\"\"\n    typecheck(username, (unicode, PathPart))\n    rec = db.one(\"\"\"\n        SELECT user_info FROM elsewhere\n        WHERE platform='openstreetmap'\n        AND user_info->'username' = %s\n    \"\"\", (username,))\n    if rec is not None:\n        user_info = rec\n    else:\n        osm_user = requests.get(\"%s/user/%s\" % (osm_api_url, username))\n        if osm_user.status_code == 200:\n            log(\"User %s found in OpenStreetMap but not in gittip.\" % username)\n            user_info = None\n        elif osm_user.status_code == 404:\n            raise Response(404,\n                           \"OpenStreetMap identity '{0}' not found.\".format(username))\n        else:\n            log(\"OpenStreetMap api responded with {0}: {1}\".format(status, content),\n                level=logging.WARNING)\n            raise Response(502, \"OpenStreetMap lookup failed with %d.\" % status)\n\n    return user_info\n", "path": "gittip/elsewhere/openstreetmap.py"}], "after_files": [{"content": "import logging\n\nimport gittip\nimport requests\nfrom aspen import json, log, Response\nfrom aspen.http.request import PathPart\nfrom aspen.utils import typecheck\nfrom gittip.elsewhere import AccountElsewhere\n\n\n\nclass OpenStreetMapAccount(AccountElsewhere):\n    platform = u'openstreetmap'\n\n    def get_url(self):\n        return self.user_info['html_url']\n\n    def get_user_name(self):\n        return self.user_info['username']\n\n    def get_platform_icon(self):\n        return \"/assets/icons/openstreetmap.12.png\"\n\n\ndef oauth_url(website, action, then=\"\"):\n    \"\"\"Return a URL to start oauth dancing with OpenStreetMap.\n\n    For GitHub we can pass action and then through a querystring. For OpenStreetMap\n    we can't, so we send people through a local URL first where we stash this\n    info in an in-memory cache (eep! needs refactoring to scale).\n\n    Not sure why website is here. Vestige from GitHub forebear?\n\n    \"\"\"\n    then = then.encode('base64').strip()\n    return \"/on/openstreetmap/redirect?action=%s&then=%s\" % (action, then)\n\n\ndef get_user_info(db, username, osm_api_url):\n    \"\"\"Get the given user's information from the DB or failing that, openstreetmap.\n\n    :param username:\n        A unicode string representing a username in OpenStreetMap.\n\n    :param osm_api_url:\n\tURL of OpenStreetMap API.\n\n    :returns:\n        A dictionary containing OpenStreetMap specific information for the user.\n    \"\"\"\n    typecheck(username, (unicode, PathPart))\n    rec = db.one(\"\"\"\n        SELECT user_info FROM elsewhere\n        WHERE platform='openstreetmap'\n        AND user_info->'username' = %s\n    \"\"\", (username,))\n    if rec is not None:\n        user_info = rec\n    else:\n        osm_user = requests.get(\"%s/user/%s\" % (osm_api_url, username))\n        if osm_user.status_code == 200:\n            log(\"User %s found in OpenStreetMap but not in gittip.\" % username)\n            user_info = None\n        elif osm_user.status_code == 404:\n            raise Response(404,\n                           \"OpenStreetMap identity '{0}' not found.\".format(username))\n        else:\n            log(\"OpenStreetMap api responded with {0}: {1}\".format(status, content),\n                level=logging.WARNING)\n            raise Response(502, \"OpenStreetMap lookup failed with %d.\" % status)\n\n    return user_info\n", "path": "gittip/elsewhere/openstreetmap.py"}]}