prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Admin User Quota sorting is off
  Thank you for opening an issue with Mailu. Please understand that issues are meant for bugs and enhancement-requests.
  For **user-support questions**, reach out to us  on [matrix](https://matrix.to/#/#mailu:tedomum.net).
  
  To be able to help you best, we need some more information.
  
  ## Before you open your issue
  - [ x] Check if no issue or pull-request for this already exists.
  - [ x] Check [documentation](https://mailu.io/master/) and [FAQ](https://mailu.io/master/faq.html). (Tip, use the search function on the documentation page)
  - [ x] You understand `Mailu` is made by volunteers in their **free time** — be conscise, civil and accept that delays can occur.
  - [ x] The title of the issue should be short and simple. It should contain specific terms related to the actual issue. Be specific while writing the title.
  
  ## Environment & Versions
  ### Environment
   - [ x] docker-compose
   - [ ] kubernetes
   - [ ] docker swarm
  
  ### Versions
  1.9
  
  ## Description
  When sorting by quota in the Admin interface the numbers are sorted like text instead of by number and bytes.
  
  
  ## Expected behaviour
  kB is smaller than MB is smaller than GB
  
  
  ![quota](https://user-images.githubusercontent.com/561565/148793187-c7464ef3-b31e-48d5-966f-07d4be315412.PNG)
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `core/admin/mailu/__init__.py`
  Content:
  ```
  1 """ Mailu admin app
  2 """
  3 
  4 import flask
  5 import flask_bootstrap
  6 
  7 from mailu import utils, debug, models, manage, configuration
  8 
  9 import hmac
  10 
  11 def create_app_from_config(config):
  12     """ Create a new application based on the given configuration
  13     """
  14     app = flask.Flask(__name__, static_folder='static', static_url_path='/static')
  15     app.cli.add_command(manage.mailu)
  16 
  17     # Bootstrap is used for error display and flash messages
  18     app.bootstrap = flask_bootstrap.Bootstrap(app)
  19 
  20     # Initialize application extensions
  21     config.init_app(app)
  22     models.db.init_app(app)
  23     utils.session.init_app(app)
  24     utils.limiter.init_app(app)
  25     utils.babel.init_app(app)
  26     utils.login.init_app(app)
  27     utils.login.user_loader(models.User.get)
  28     utils.proxy.init_app(app)
  29     utils.migrate.init_app(app, models.db)
  30 
  31     app.device_cookie_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('DEVICE_COOKIE_KEY', 'utf-8'), 'sha256').digest()
  32     app.temp_token_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('WEBMAIL_TEMP_TOKEN_KEY', 'utf-8'), 'sha256').digest()
  33     app.srs_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('SRS_KEY', 'utf-8'), 'sha256').digest()
  34 
  35     # Initialize list of translations
  36     app.config.translations = {
  37         str(locale): locale
  38         for locale in sorted(
  39             utils.babel.list_translations(),
  40             key=lambda l: l.get_language_name().title()
  41         )
  42     }
  43 
  44     # Initialize debugging tools
  45     if app.config.get("DEBUG"):
  46         debug.toolbar.init_app(app)
  47     if app.config.get("DEBUG_PROFILER"):
  48         debug.profiler.init_app(app)
  49     if assets := app.config.get('DEBUG_ASSETS'):
  50         app.static_folder = assets
  51 
  52     # Inject the default variables in the Jinja parser
  53     # TODO: move this to blueprints when needed
  54     @app.context_processor
  55     def inject_defaults():
  56         signup_domains = models.Domain.query.filter_by(signup_enabled=True).all()
  57         return dict(
  58             signup_domains= signup_domains,
  59             config        = app.config,
  60         )
  61 
  62     # Jinja filters
  63     @app.template_filter()
  64     def format_date(value):
  65         return utils.flask_babel.format_date(value) if value else ''
  66 
  67     @app.template_filter()
  68     def format_datetime(value):
  69         return utils.flask_babel.format_datetime(value) if value else ''
  70 
  71     # Import views
  72     from mailu import ui, internal, sso
  73     app.register_blueprint(ui.ui, url_prefix=app.config['WEB_ADMIN'])
  74     app.register_blueprint(internal.internal, url_prefix='/internal')
  75     app.register_blueprint(sso.sso, url_prefix='/sso')
  76     return app
  77 
  78 
  79 def create_app():
  80     """ Create a new application based on the config module
  81     """
  82     config = configuration.ConfigManager()
  83     return create_app_from_config(config)
  84 
  85
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/core/admin/mailu/__init__.py b/core/admin/mailu/__init__.py
  --- a/core/admin/mailu/__init__.py
  +++ b/core/admin/mailu/__init__.py
  @@ -57,6 +57,7 @@
           return dict(
               signup_domains= signup_domains,
               config        = app.config,
  +            get_locale    = utils.get_locale,
           )
   
       # Jinja filters
  
verification_info: {"golden_diff": "diff --git a/core/admin/mailu/__init__.py b/core/admin/mailu/__init__.py\n--- a/core/admin/mailu/__init__.py\n+++ b/core/admin/mailu/__init__.py\n@@ -57,6 +57,7 @@\n         return dict(\n             signup_domains= signup_domains,\n             config        = app.config,\n+            get_locale    = utils.get_locale,\n         )\n \n     # Jinja filters\n", "issue": "Admin User Quota sorting is off\nThank you for opening an issue with Mailu. Please understand that issues are meant for bugs and enhancement-requests.\r\nFor **user-support questions**, reach out to us  on [matrix](https://matrix.to/#/#mailu:tedomum.net).\r\n\r\nTo be able to help you best, we need some more information.\r\n\r\n## Before you open your issue\r\n- [ x] Check if no issue or pull-request for this already exists.\r\n- [ x] Check [documentation](https://mailu.io/master/) and [FAQ](https://mailu.io/master/faq.html). (Tip, use the search function on the documentation page)\r\n- [ x] You understand `Mailu` is made by volunteers in their **free time** \u2014 be conscise, civil and accept that delays can occur.\r\n- [ x] The title of the issue should be short and simple. It should contain specific terms related to the actual issue. Be specific while writing the title.\r\n\r\n## Environment & Versions\r\n### Environment\r\n - [ x] docker-compose\r\n - [ ] kubernetes\r\n - [ ] docker swarm\r\n\r\n### Versions\r\n1.9\r\n\r\n## Description\r\nWhen sorting by quota in the Admin interface the numbers are sorted like text instead of by number and bytes.\r\n\r\n\r\n## Expected behaviour\r\nkB is smaller than MB is smaller than GB\r\n\r\n\r\n![quota](https://user-images.githubusercontent.com/561565/148793187-c7464ef3-b31e-48d5-966f-07d4be315412.PNG)\r\n\r\n\n", "before_files": [{"content": "\"\"\" Mailu admin app\n\"\"\"\n\nimport flask\nimport flask_bootstrap\n\nfrom mailu import utils, debug, models, manage, configuration\n\nimport hmac\n\ndef create_app_from_config(config):\n    \"\"\" Create a new application based on the given configuration\n    \"\"\"\n    app = flask.Flask(__name__, static_folder='static', static_url_path='/static')\n    app.cli.add_command(manage.mailu)\n\n    # Bootstrap is used for error display and flash messages\n    app.bootstrap = flask_bootstrap.Bootstrap(app)\n\n    # Initialize application extensions\n    config.init_app(app)\n    models.db.init_app(app)\n    utils.session.init_app(app)\n    utils.limiter.init_app(app)\n    utils.babel.init_app(app)\n    utils.login.init_app(app)\n    utils.login.user_loader(models.User.get)\n    utils.proxy.init_app(app)\n    utils.migrate.init_app(app, models.db)\n\n    app.device_cookie_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('DEVICE_COOKIE_KEY', 'utf-8'), 'sha256').digest()\n    app.temp_token_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('WEBMAIL_TEMP_TOKEN_KEY', 'utf-8'), 'sha256').digest()\n    app.srs_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('SRS_KEY', 'utf-8'), 'sha256').digest()\n\n    # Initialize list of translations\n    app.config.translations = {\n        str(locale): locale\n        for locale in sorted(\n            utils.babel.list_translations(),\n            key=lambda l: l.get_language_name().title()\n        )\n    }\n\n    # Initialize debugging tools\n    if app.config.get(\"DEBUG\"):\n        debug.toolbar.init_app(app)\n    if app.config.get(\"DEBUG_PROFILER\"):\n        debug.profiler.init_app(app)\n    if assets := app.config.get('DEBUG_ASSETS'):\n        app.static_folder = assets\n\n    # Inject the default variables in the Jinja parser\n    # TODO: move this to blueprints when needed\n    @app.context_processor\n    def inject_defaults():\n        signup_domains = models.Domain.query.filter_by(signup_enabled=True).all()\n        return dict(\n            signup_domains= signup_domains,\n            config        = app.config,\n        )\n\n    # Jinja filters\n    @app.template_filter()\n    def format_date(value):\n        return utils.flask_babel.format_date(value) if value else ''\n\n    @app.template_filter()\n    def format_datetime(value):\n        return utils.flask_babel.format_datetime(value) if value else ''\n\n    # Import views\n    from mailu import ui, internal, sso\n    app.register_blueprint(ui.ui, url_prefix=app.config['WEB_ADMIN'])\n    app.register_blueprint(internal.internal, url_prefix='/internal')\n    app.register_blueprint(sso.sso, url_prefix='/sso')\n    return app\n\n\ndef create_app():\n    \"\"\" Create a new application based on the config module\n    \"\"\"\n    config = configuration.ConfigManager()\n    return create_app_from_config(config)\n\n", "path": "core/admin/mailu/__init__.py"}], "after_files": [{"content": "\"\"\" Mailu admin app\n\"\"\"\n\nimport flask\nimport flask_bootstrap\n\nfrom mailu import utils, debug, models, manage, configuration\n\nimport hmac\n\ndef create_app_from_config(config):\n    \"\"\" Create a new application based on the given configuration\n    \"\"\"\n    app = flask.Flask(__name__, static_folder='static', static_url_path='/static')\n    app.cli.add_command(manage.mailu)\n\n    # Bootstrap is used for error display and flash messages\n    app.bootstrap = flask_bootstrap.Bootstrap(app)\n\n    # Initialize application extensions\n    config.init_app(app)\n    models.db.init_app(app)\n    utils.session.init_app(app)\n    utils.limiter.init_app(app)\n    utils.babel.init_app(app)\n    utils.login.init_app(app)\n    utils.login.user_loader(models.User.get)\n    utils.proxy.init_app(app)\n    utils.migrate.init_app(app, models.db)\n\n    app.device_cookie_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('DEVICE_COOKIE_KEY', 'utf-8'), 'sha256').digest()\n    app.temp_token_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('WEBMAIL_TEMP_TOKEN_KEY', 'utf-8'), 'sha256').digest()\n    app.srs_key = hmac.new(bytearray(app.secret_key, 'utf-8'), bytearray('SRS_KEY', 'utf-8'), 'sha256').digest()\n\n    # Initialize list of translations\n    app.config.translations = {\n        str(locale): locale\n        for locale in sorted(\n            utils.babel.list_translations(),\n            key=lambda l: l.get_language_name().title()\n        )\n    }\n\n    # Initialize debugging tools\n    if app.config.get(\"DEBUG\"):\n        debug.toolbar.init_app(app)\n    if app.config.get(\"DEBUG_PROFILER\"):\n        debug.profiler.init_app(app)\n    if assets := app.config.get('DEBUG_ASSETS'):\n        app.static_folder = assets\n\n    # Inject the default variables in the Jinja parser\n    # TODO: move this to blueprints when needed\n    @app.context_processor\n    def inject_defaults():\n        signup_domains = models.Domain.query.filter_by(signup_enabled=True).all()\n        return dict(\n            signup_domains= signup_domains,\n            config        = app.config,\n            get_locale    = utils.get_locale,\n        )\n\n    # Jinja filters\n    @app.template_filter()\n    def format_date(value):\n        return utils.flask_babel.format_date(value) if value else ''\n\n    @app.template_filter()\n    def format_datetime(value):\n        return utils.flask_babel.format_datetime(value) if value else ''\n\n    # Import views\n    from mailu import ui, internal, sso\n    app.register_blueprint(ui.ui, url_prefix=app.config['WEB_ADMIN'])\n    app.register_blueprint(internal.internal, url_prefix='/internal')\n    app.register_blueprint(sso.sso, url_prefix='/sso')\n    return app\n\n\ndef create_app():\n    \"\"\" Create a new application based on the config module\n    \"\"\"\n    config = configuration.ConfigManager()\n    return create_app_from_config(config)\n\n", "path": "core/admin/mailu/__init__.py"}]}