Self hosted FLOSS fitness/workout, nutrition and weight tracker
Add context parameter to tasks
Roland Geidere1557ca32843
diff --git a/tasks.py b/tasks.pyindex cb2dc868b..36eda386b 100644--- a/tasks.py+++ b/tasks.py@@ -40,7 +40,7 @@ logger = logging.getLogger(__name__)'browser': 'Whether to open the application in a browser window. Default: false','settings-path': 'Path to settings file (absolute path recommended). Leave empty for default','extra-args': 'Additional arguments to pass to the builtin server. Pass as string: "--arg1 --arg2=value". Default: none'})-def start_wger(address='localhost', port=8000, browser=False, settings_path=None, extra_args=''):+def start_wger(context, address='localhost', port=8000, browser=False, settings_path=None, extra_args=''):'''Start the application using django's built in webserver'''@@ -64,7 +64,8 @@ def start_wger(address='localhost', port=8000, browser=False, settings_path=None'port': 'Port to use. Default: 8000','browser': 'Whether to open the application in a browser window. Default: false','start-server': 'Whether to start the development server. Default: true'})-def bootstrap_wger(settings_path=None,+def bootstrap_wger(context,+ settings_path=None,database_path=None,address='localhost',port=8000,@@ -113,7 +114,7 @@ def bootstrap_wger(settings_path=None,'database-path': 'Path to sqlite database (absolute path recommended). Leave empty for default','database-type': 'Database type to use. Supported: sqlite3, postgresql. Default: sqlite3','key-length': 'Lenght of the generated secret key. Default: 50'})-def create_settings(settings_path=None, database_path=None, url=None, database_type='sqlite3', key_length=50):+def create_settings(context, settings_path=None, database_path=None, url=None, database_type='sqlite3', key_length=50):'''Creates a local settings file'''@@ -180,7 +181,7 @@ def create_settings(settings_path=None, database_path=None, url=None, database_t@task(help={'settings-path': 'Path to settings file (absolute path recommended). Leave empty for default'})-def create_or_reset_admin(settings_path=None):+def create_or_reset_admin(context, settings_path=None):'''Creates an admin user or resets the password for an existing one'''@@ -206,7 +207,7 @@ def create_or_reset_admin(settings_path=None):@task(help={'settings-path': 'Path to settings file (absolute path recommended). Leave empty for default'})-def migrate_db(settings_path=None):+def migrate_db(context, settings_path=None):'''Run all database migrations'''@@ -218,7 +219,7 @@ def migrate_db(settings_path=None):@task(help={'settings-path': 'Path to settings file (absolute path recommended). Leave empty for default'})-def load_fixtures(settings_path=None):+def load_fixtures(context, settings_path=None):'''Loads all fixtures'''@@ -274,7 +275,7 @@ def load_fixtures(settings_path=None):@task-def config_location():+def config_location(context):'''Returns the default location for the settings file and the data folder'''