prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  `kinto create-user` doesn't override the password if the user already exists.
  
  
  </issue>
  <code>
  [start of kinto/plugins/accounts/scripts.py]
  1 import logging
  2 import getpass
  3 from pyramid.settings import asbool
  4 
  5 from .utils import hash_password
  6 from .views import AccountIdGenerator
  7 
  8 
  9 logger = logging.getLogger(__name__)
  10 
  11 
  12 def create_user(env, username=None, password=None):
  13     """Administrative command to create a new user."""
  14     registry = env['registry']
  15     settings = registry.settings
  16     readonly_mode = asbool(settings.get('readonly', False))
  17     if readonly_mode:
  18         message = 'Cannot create a user with a readonly server.'
  19         logger.error(message)
  20         return 51
  21 
  22     if 'kinto.plugins.accounts' not in settings['includes']:
  23         message = 'Cannot create a user when the accounts plugin is not installed.'
  24         logger.error(message)
  25         return 52
  26 
  27     try:
  28         validator = AccountIdGenerator()
  29         if username is None:
  30             username = input('Username: ')
  31         while not validator.match(username):
  32             print('{} is not a valid username.')
  33             print('Username should match {0!r}, please try again.'.format(validator.regexp))
  34             username = input('Username: ')
  35 
  36         if password is None:
  37             while True:  # The user didn't entered twice the same password
  38                 password = getpass.getpass('Please enter a password for {}: '.format(username))
  39                 confirm = getpass.getpass('Please confirm the password: '.format(username))
  40 
  41                 if password != confirm:
  42                     print('Sorry, passwords do not match, please try again.')
  43                 else:
  44                     break
  45     except EOFError:
  46         print('User creation aborted')
  47         return 53
  48 
  49     print("Creating user '{}'".format(username))
  50     record = {'id': username, 'password': hash_password(password)}
  51     registry.storage.create(collection_id='account',
  52                             parent_id=username,
  53                             record=record,
  54                             ignore_conflict=True)
  55     registry.permission.add_principal_to_ace('/accounts/{}'.format(username),
  56                                              'write',
  57                                              'account:{}'.format(username))
  58 
  59     return 0
  60
  [end of kinto/plugins/accounts/scripts.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/kinto/plugins/accounts/scripts.py b/kinto/plugins/accounts/scripts.py
  --- a/kinto/plugins/accounts/scripts.py
  +++ b/kinto/plugins/accounts/scripts.py
  @@ -1,5 +1,7 @@
   import logging
   import getpass
  +
  +import transaction as current_transaction
   from pyramid.settings import asbool
   
   from .utils import hash_password
  @@ -56,4 +58,6 @@
                                                'write',
                                                'account:{}'.format(username))
   
  +    current_transaction.commit()
  +
       return 0
  
verification_info: {"golden_diff": "diff --git a/kinto/plugins/accounts/scripts.py b/kinto/plugins/accounts/scripts.py\n--- a/kinto/plugins/accounts/scripts.py\n+++ b/kinto/plugins/accounts/scripts.py\n@@ -1,5 +1,7 @@\n import logging\n import getpass\n+\n+import transaction as current_transaction\n from pyramid.settings import asbool\n \n from .utils import hash_password\n@@ -56,4 +58,6 @@\n                                              'write',\n                                              'account:{}'.format(username))\n \n+    current_transaction.commit()\n+\n     return 0\n", "issue": "`kinto create-user` doesn't override the password if the user already exists.\n\n", "before_files": [{"content": "import logging\nimport getpass\nfrom pyramid.settings import asbool\n\nfrom .utils import hash_password\nfrom .views import AccountIdGenerator\n\n\nlogger = logging.getLogger(__name__)\n\n\ndef create_user(env, username=None, password=None):\n    \"\"\"Administrative command to create a new user.\"\"\"\n    registry = env['registry']\n    settings = registry.settings\n    readonly_mode = asbool(settings.get('readonly', False))\n    if readonly_mode:\n        message = 'Cannot create a user with a readonly server.'\n        logger.error(message)\n        return 51\n\n    if 'kinto.plugins.accounts' not in settings['includes']:\n        message = 'Cannot create a user when the accounts plugin is not installed.'\n        logger.error(message)\n        return 52\n\n    try:\n        validator = AccountIdGenerator()\n        if username is None:\n            username = input('Username: ')\n        while not validator.match(username):\n            print('{} is not a valid username.')\n            print('Username should match {0!r}, please try again.'.format(validator.regexp))\n            username = input('Username: ')\n\n        if password is None:\n            while True:  # The user didn't entered twice the same password\n                password = getpass.getpass('Please enter a password for {}: '.format(username))\n                confirm = getpass.getpass('Please confirm the password: '.format(username))\n\n                if password != confirm:\n                    print('Sorry, passwords do not match, please try again.')\n                else:\n                    break\n    except EOFError:\n        print('User creation aborted')\n        return 53\n\n    print(\"Creating user '{}'\".format(username))\n    record = {'id': username, 'password': hash_password(password)}\n    registry.storage.create(collection_id='account',\n                            parent_id=username,\n                            record=record,\n                            ignore_conflict=True)\n    registry.permission.add_principal_to_ace('/accounts/{}'.format(username),\n                                             'write',\n                                             'account:{}'.format(username))\n\n    return 0\n", "path": "kinto/plugins/accounts/scripts.py"}]}