prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <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'
  ```
  
  
  </issue>
  <code>
  [start of gittip/elsewhere/openstreetmap.py]
  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 of gittip/elsewhere/openstreetmap.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: 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.
  
verification_info: {"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"}]}