gerd.wger: init
This commit is contained in:
parent
80ef4fabc8
commit
2f2993ac16
16 changed files with 733 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
diff --git a/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py b/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py
|
||||
index 0e98c65..4a4c13e 100644
|
||||
--- a/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py
|
||||
+++ b/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py
|
||||
@@ -12,7 +12,7 @@ from inspect import ismethod
|
||||
|
||||
from django.utils.html import escape
|
||||
from django.utils.safestring import mark_safe
|
||||
-from django.utils.encoding import smart_text
|
||||
+from django.utils.encoding import smart_str
|
||||
from django.db.models import Model
|
||||
from django.conf import settings
|
||||
from django import template, VERSION
|
||||
@@ -148,7 +148,7 @@ def render_breadcrumbs(context, *args):
|
||||
kwargs=view_kwargs, current_app=current_app)
|
||||
except NoReverseMatch:
|
||||
url = viewname
|
||||
- links.append((url, smart_text(label) if label else label))
|
||||
+ links.append((url, smart_str(label) if label else label))
|
||||
|
||||
if not links:
|
||||
return ''
|
36
machines/gerd/services/wger/wgerpkg/patches/manage.patch
Normal file
36
machines/gerd/services/wger/wgerpkg/patches/manage.patch
Normal file
|
@ -0,0 +1,36 @@
|
|||
diff --git a/manage.py b/manage.py
|
||||
index 873291be6..368de89fe 100644
|
||||
--- a/manage.py
|
||||
+++ b/manage.py
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
# Standard Library
|
||||
import sys
|
||||
+import os
|
||||
|
||||
# Django
|
||||
from django.core.management import execute_from_command_line
|
||||
@@ -12,13 +13,20 @@ from wger.tasks import (
|
||||
setup_django_environment,
|
||||
)
|
||||
|
||||
-
|
||||
-if __name__ == '__main__':
|
||||
+def main():
|
||||
# If user passed the settings flag ignore the default wger settings
|
||||
- if not any('--settings' in s for s in sys.argv):
|
||||
+ settings_file = os.getenv("WGER_SETTINGS")
|
||||
+
|
||||
+ if not any('--settings' in s for s in sys.argv) and not settings_file:
|
||||
setup_django_environment(get_path('settings.py'))
|
||||
|
||||
+ if settings_file:
|
||||
+ setup_django_environment(get_path(settings_file))
|
||||
+
|
||||
# Alternative to above
|
||||
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||
|
||||
execute_from_command_line(sys.argv)
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ main()
|
24
machines/gerd/services/wger/wgerpkg/patches/pyproject.patch
Normal file
24
machines/gerd/services/wger/wgerpkg/patches/pyproject.patch
Normal file
|
@ -0,0 +1,24 @@
|
|||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index f10460b1e..62377bd9c 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -35,7 +35,8 @@ Issues = "https://github.com/wger-project/wger/issues"
|
||||
Changelog = "https://wger.readthedocs.io/en/latest/changelog.html"
|
||||
|
||||
[project.scripts]
|
||||
-wger = "wger.__main__:main"
|
||||
+wger = "wger.tasks:main"
|
||||
+manage = "wger.manage:main"
|
||||
|
||||
[tool.setuptools]
|
||||
include-package-data = false
|
||||
@@ -47,6 +48,9 @@ dependencies = { file = ["requirements.txt"] }
|
||||
[tool.distutils.bdist_wheel]
|
||||
universal = 1
|
||||
|
||||
+[tool.hatch.build.targets.wheel.force-include]
|
||||
+"wger/settings_global.py" = "wger/settings_global.py"
|
||||
+
|
||||
|
||||
[tool.ruff]
|
||||
# Exclude a variety of commonly ignored directories.
|
35
machines/gerd/services/wger/wgerpkg/patches/tasks.patch
Normal file
35
machines/gerd/services/wger/wgerpkg/patches/tasks.patch
Normal file
|
@ -0,0 +1,35 @@
|
|||
diff --git a/wger/tasks.py b/wger/tasks.py
|
||||
index b1b4b7c65..50bf95b7c 100644
|
||||
--- a/wger/tasks.py
|
||||
+++ b/wger/tasks.py
|
||||
@@ -31,7 +31,7 @@ from django.utils.crypto import get_random_string
|
||||
|
||||
# Third Party
|
||||
import requests
|
||||
-from invoke import task
|
||||
+from invoke import task, Program, Collection
|
||||
from tqdm import tqdm
|
||||
|
||||
|
||||
@@ -358,3 +358,20 @@ def database_exists():
|
||||
sys.exit(0)
|
||||
else:
|
||||
return True
|
||||
+
|
||||
+def main():
|
||||
+ ns = Collection(
|
||||
+ start,
|
||||
+ bootstrap,
|
||||
+ create_settings,
|
||||
+ create_or_reset_admin,
|
||||
+ migrate_db,
|
||||
+ load_fixtures,
|
||||
+ load_online_fixtures,
|
||||
+ )
|
||||
+ program = Program(namespace=ns)
|
||||
+ program.run()
|
||||
+
|
||||
+
|
||||
+if __name__ == "__main__":
|
||||
+ main()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue