prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Theme reset from CLI
  There needs to be a way to reset the theme and other kinds of unrecoverable errors from the CLI. 
  
  Context: https://community.majorleaguecyber.org/t/ctfd-templatenotfound/51
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `manage.py`
  Content:
  ```
  1 from flask import Flask
  2 from flask_sqlalchemy import SQLAlchemy
  3 from flask_script import Manager
  4 from flask_migrate import Migrate, MigrateCommand
  5 from CTFd import create_app
  6 from CTFd.models import *
  7 
  8 app = create_app()
  9 
  10 manager = Manager(app)
  11 manager.add_command('db', MigrateCommand)
  12 
  13 if __name__ == '__main__':
  14     manager.run()
  15
  ```
  --- 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/manage.py b/manage.py
  --- a/manage.py
  +++ b/manage.py
  @@ -3,6 +3,7 @@
   from flask_script import Manager
   from flask_migrate import Migrate, MigrateCommand
   from CTFd import create_app
  +from CTFd.utils import get_config as get_config_util, set_config as set_config_util
   from CTFd.models import *
   
   app = create_app()
  @@ -10,5 +11,18 @@
   manager = Manager(app)
   manager.add_command('db', MigrateCommand)
   
  -if __name__ == '__main__':
  +
  +@manager.command
  +def get_config(key):
  +    with app.app_context():
  +        print(get_config_util(key))
  +
  +
  +@manager.command
  +def set_config(key, value):
  +    with app.app_context():
  +        print(set_config_util(key, value).value)
  +
  +
  +if __name__ == "__main__":
       manager.run()
  
verification_info: {"golden_diff": "diff --git a/manage.py b/manage.py\n--- a/manage.py\n+++ b/manage.py\n@@ -3,6 +3,7 @@\n from flask_script import Manager\n from flask_migrate import Migrate, MigrateCommand\n from CTFd import create_app\n+from CTFd.utils import get_config as get_config_util, set_config as set_config_util\n from CTFd.models import *\n \n app = create_app()\n@@ -10,5 +11,18 @@\n manager = Manager(app)\n manager.add_command('db', MigrateCommand)\n \n-if __name__ == '__main__':\n+\n+@manager.command\n+def get_config(key):\n+    with app.app_context():\n+        print(get_config_util(key))\n+\n+\n+@manager.command\n+def set_config(key, value):\n+    with app.app_context():\n+        print(set_config_util(key, value).value)\n+\n+\n+if __name__ == \"__main__\":\n     manager.run()\n", "issue": "Theme reset from CLI\nThere needs to be a way to reset the theme and other kinds of unrecoverable errors from the CLI. \r\n\r\nContext: https://community.majorleaguecyber.org/t/ctfd-templatenotfound/51\n", "before_files": [{"content": "from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_script import Manager\nfrom flask_migrate import Migrate, MigrateCommand\nfrom CTFd import create_app\nfrom CTFd.models import *\n\napp = create_app()\n\nmanager = Manager(app)\nmanager.add_command('db', MigrateCommand)\n\nif __name__ == '__main__':\n    manager.run()\n", "path": "manage.py"}], "after_files": [{"content": "from flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_script import Manager\nfrom flask_migrate import Migrate, MigrateCommand\nfrom CTFd import create_app\nfrom CTFd.utils import get_config as get_config_util, set_config as set_config_util\nfrom CTFd.models import *\n\napp = create_app()\n\nmanager = Manager(app)\nmanager.add_command('db', MigrateCommand)\n\n\n@manager.command\ndef get_config(key):\n    with app.app_context():\n        print(get_config_util(key))\n\n\n@manager.command\ndef set_config(key, value):\n    with app.app_context():\n        print(set_config_util(key, value).value)\n\n\nif __name__ == \"__main__\":\n    manager.run()\n", "path": "manage.py"}]}