prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  broken facebook link when no user_name
  If all we have is a user_id, we construct the URL improperly. In that case we need:
  
  `http://facebook.com/profile.php?id=$ID`
  
  But we have:
  
  `http://facebook.com/None`
  
  broken facebook link when no user_name
  If all we have is a user_id, we construct the URL improperly. In that case we need:
  
  `http://facebook.com/profile.php?id=$ID`
  
  But we have:
  
  `http://facebook.com/None`
  
  
  </issue>
  <code>
  [start of gratipay/elsewhere/facebook.py]
  1 from __future__ import absolute_import, division, print_function, unicode_literals
  2 
  3 from gratipay.elsewhere import PlatformOAuth2
  4 from gratipay.elsewhere._extractors import key
  5 
  6 
  7 class Facebook(PlatformOAuth2):
  8 
  9     # Platform attributes
  10     name = 'facebook'
  11     display_name = 'Facebook'
  12     account_url = 'https://www.facebook.com/{user_name}'
  13 
  14     # Auth attributes
  15     auth_url = 'https://www.facebook.com/dialog/oauth'
  16     access_token_url = 'https://graph.facebook.com/oauth/access_token'
  17     oauth_default_scope = ['public_profile,email']
  18 
  19     # API attributes
  20     api_format = 'json'
  21     api_url = 'https://graph.facebook.com'
  22     api_user_info_path = '/{user_name}'
  23     api_user_self_info_path = '/me'
  24 
  25     # User info extractors
  26     x_user_id = key('id')
  27     x_user_name = key('username')
  28     x_display_name = key('name')
  29     x_email = key('email')
  30 
  31     def x_avatar_url(self, extracted, info, default):
  32         return 'https://graph.facebook.com/' + extracted.user_id + '/picture?width=256&height=256'
  33
  [end of gratipay/elsewhere/facebook.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/gratipay/elsewhere/facebook.py b/gratipay/elsewhere/facebook.py
  --- a/gratipay/elsewhere/facebook.py
  +++ b/gratipay/elsewhere/facebook.py
  @@ -9,7 +9,7 @@
       # Platform attributes
       name = 'facebook'
       display_name = 'Facebook'
  -    account_url = 'https://www.facebook.com/{user_name}'
  +    account_url = 'https://www.facebook.com/profile.php?id={user_id}'
   
       # Auth attributes
       auth_url = 'https://www.facebook.com/dialog/oauth'
  
verification_info: {"golden_diff": "diff --git a/gratipay/elsewhere/facebook.py b/gratipay/elsewhere/facebook.py\n--- a/gratipay/elsewhere/facebook.py\n+++ b/gratipay/elsewhere/facebook.py\n@@ -9,7 +9,7 @@\n     # Platform attributes\n     name = 'facebook'\n     display_name = 'Facebook'\n-    account_url = 'https://www.facebook.com/{user_name}'\n+    account_url = 'https://www.facebook.com/profile.php?id={user_id}'\n \n     # Auth attributes\n     auth_url = 'https://www.facebook.com/dialog/oauth'\n", "issue": "broken facebook link when no user_name\nIf all we have is a user_id, we construct the URL improperly. In that case we need:\n\n`http://facebook.com/profile.php?id=$ID`\n\nBut we have:\n\n`http://facebook.com/None`\n\nbroken facebook link when no user_name\nIf all we have is a user_id, we construct the URL improperly. In that case we need:\n\n`http://facebook.com/profile.php?id=$ID`\n\nBut we have:\n\n`http://facebook.com/None`\n\n", "before_files": [{"content": "from __future__ import absolute_import, division, print_function, unicode_literals\n\nfrom gratipay.elsewhere import PlatformOAuth2\nfrom gratipay.elsewhere._extractors import key\n\n\nclass Facebook(PlatformOAuth2):\n\n    # Platform attributes\n    name = 'facebook'\n    display_name = 'Facebook'\n    account_url = 'https://www.facebook.com/{user_name}'\n\n    # Auth attributes\n    auth_url = 'https://www.facebook.com/dialog/oauth'\n    access_token_url = 'https://graph.facebook.com/oauth/access_token'\n    oauth_default_scope = ['public_profile,email']\n\n    # API attributes\n    api_format = 'json'\n    api_url = 'https://graph.facebook.com'\n    api_user_info_path = '/{user_name}'\n    api_user_self_info_path = '/me'\n\n    # User info extractors\n    x_user_id = key('id')\n    x_user_name = key('username')\n    x_display_name = key('name')\n    x_email = key('email')\n\n    def x_avatar_url(self, extracted, info, default):\n        return 'https://graph.facebook.com/' + extracted.user_id + '/picture?width=256&height=256'\n", "path": "gratipay/elsewhere/facebook.py"}]}