From 620c1cdce80c23dfe75a34d199e762adbd4665f9 Mon Sep 17 00:00:00 2001 From: BoAnd Date: Sun, 25 Feb 2024 17:07:08 +0100 Subject: [PATCH 01/11] Upgrade packages. --- requirements.txt | 18 +++++++++--------- stregsystem/templates/admin/index.html | 2 +- .../admin/stregsystem/batch_payment.html | 2 +- .../admin/stregsystem/batch_payment_done.html | 2 +- .../admin/stregsystem/mobilepaytool.html | 2 +- .../admin/stregsystem/razzia/razzia.html | 2 +- .../admin/stregsystem/razzia/wizard.html | 2 +- .../admin/stregsystem/razzia/wizard_view.html | 2 +- .../admin/stregsystem/report/index.html | 2 +- .../admin/stregsystem/report/sales.html | 2 +- .../report/user_purchases_in_categories.html | 2 +- stregsystem/templates/stregsystem/base.html | 4 ++-- stregsystem/templates/stregsystem/index.html | 6 +++--- stregsystem/templates/stregsystem/ranks.html | 4 ++-- 14 files changed, 26 insertions(+), 26 deletions(-) diff --git a/requirements.txt b/requirements.txt index 734276b8..7591d8ac 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -Django==2.2.28 -Pillow==8.3.2 -Coverage==4.4.1 -pytz==2021.3 -freezegun==0.3.15 -Django-Select2==5.11.1 -django-debug-toolbar==1.11.1 -requests==2.24.0 -qrcode==6.1 +Django==5.0.2 +Pillow==10.2.0 +Coverage==7.4.3 +pytz==2024.1 +freezegun==1.4.0 +Django-Select2==8.1.2 +django-debug-toolbar==4.3.0 +requests==2.31.0 +qrcode==7.4.2 diff --git a/stregsystem/templates/admin/index.html b/stregsystem/templates/admin/index.html index b6f957c4..2f56a48e 100644 --- a/stregsystem/templates/admin/index.html +++ b/stregsystem/templates/admin/index.html @@ -1,6 +1,6 @@ {% extends "admin/base_site.html" %} {% load i18n %} -{% load admin_static %} +{% load static %} {% block extrastyle %}{{ block.super }}{% endblock %} diff --git a/stregsystem/templates/admin/stregsystem/batch_payment.html b/stregsystem/templates/admin/stregsystem/batch_payment.html index f2265765..0744a1d8 100644 --- a/stregsystem/templates/admin/stregsystem/batch_payment.html +++ b/stregsystem/templates/admin/stregsystem/batch_payment.html @@ -13,7 +13,7 @@ {% endblock %} {% block content %} -{% load admin_static %} +{% load static %}
{% csrf_token %} diff --git a/stregsystem/templates/admin/stregsystem/batch_payment_done.html b/stregsystem/templates/admin/stregsystem/batch_payment_done.html index 339da08d..5697644f 100644 --- a/stregsystem/templates/admin/stregsystem/batch_payment_done.html +++ b/stregsystem/templates/admin/stregsystem/batch_payment_done.html @@ -4,7 +4,7 @@ {% block breadcrumbs %}{% endblock %} {% block content %} -{% load admin_static %} +{% load static %}
diff --git a/stregsystem/templates/admin/stregsystem/mobilepaytool.html b/stregsystem/templates/admin/stregsystem/mobilepaytool.html index 06081b0d..e34acd66 100644 --- a/stregsystem/templates/admin/stregsystem/mobilepaytool.html +++ b/stregsystem/templates/admin/stregsystem/mobilepaytool.html @@ -22,7 +22,7 @@ {% endblock %} {% block content %} - {% load admin_static %} + {% load static %} {% load stregsystem_extras %}
diff --git a/stregsystem/templates/admin/stregsystem/razzia/razzia.html b/stregsystem/templates/admin/stregsystem/razzia/razzia.html index 9beab83e..78ab72ec 100644 --- a/stregsystem/templates/admin/stregsystem/razzia/razzia.html +++ b/stregsystem/templates/admin/stregsystem/razzia/razzia.html @@ -3,7 +3,7 @@ {% block title %}{{title|default:"Razzia"}}{% endblock %} {% block content %} -{% load admin_static %} +{% load static %} diff --git a/stregsystem/templates/admin/stregsystem/razzia/wizard.html b/stregsystem/templates/admin/stregsystem/razzia/wizard.html index 2e8aa8a6..1ba48b4d 100644 --- a/stregsystem/templates/admin/stregsystem/razzia/wizard.html +++ b/stregsystem/templates/admin/stregsystem/razzia/wizard.html @@ -4,7 +4,7 @@ {% block breadcrumbs %}{% endblock %} {% block content %} -{% load admin_static %} +{% load static %} diff --git a/stregsystem/templates/admin/stregsystem/razzia/wizard_view.html b/stregsystem/templates/admin/stregsystem/razzia/wizard_view.html index 766d3a2e..68fbb250 100644 --- a/stregsystem/templates/admin/stregsystem/razzia/wizard_view.html +++ b/stregsystem/templates/admin/stregsystem/razzia/wizard_view.html @@ -4,7 +4,7 @@ {% block breadcrumbs %}{% endblock %} {% block content %} -{% load admin_static %} +{% load static %} diff --git a/stregsystem/templates/admin/stregsystem/report/index.html b/stregsystem/templates/admin/stregsystem/report/index.html index 056c7d0c..04b97f66 100644 --- a/stregsystem/templates/admin/stregsystem/report/index.html +++ b/stregsystem/templates/admin/stregsystem/report/index.html @@ -1,6 +1,6 @@ {% extends "admin/base_site.html" %} {% load i18n %} -{% load admin_static %} +{% load static %} {% block extrastyle %}{{ block.super }}{% endblock %} diff --git a/stregsystem/templates/admin/stregsystem/report/sales.html b/stregsystem/templates/admin/stregsystem/report/sales.html index 513f9a64..b1a8c7da 100644 --- a/stregsystem/templates/admin/stregsystem/report/sales.html +++ b/stregsystem/templates/admin/stregsystem/report/sales.html @@ -4,7 +4,7 @@ {% block breadcrumbs %}{% endblock %} {% block content %} -{% load admin_static %} +{% load static %} diff --git a/stregsystem/templates/admin/stregsystem/report/user_purchases_in_categories.html b/stregsystem/templates/admin/stregsystem/report/user_purchases_in_categories.html index 864ec966..90487590 100644 --- a/stregsystem/templates/admin/stregsystem/report/user_purchases_in_categories.html +++ b/stregsystem/templates/admin/stregsystem/report/user_purchases_in_categories.html @@ -13,7 +13,7 @@ {% block breadcrumbs %}{% endblock %} {% block content %} -{% load admin_static %} +{% load static %}
{% csrf_token %} diff --git a/stregsystem/templates/stregsystem/base.html b/stregsystem/templates/stregsystem/base.html index 4ae246d4..f6d3fe30 100644 --- a/stregsystem/templates/stregsystem/base.html +++ b/stregsystem/templates/stregsystem/base.html @@ -35,9 +35,9 @@

{% block heading %}TREOENs STREGSYSTEM -{% ifnotequal room.id 1 %} +{% if room.id != 1 %} : {{room.description}} -{% endifnotequal %} +{% endif %} {% endblock %}

diff --git a/stregsystem/templates/stregsystem/index.html b/stregsystem/templates/stregsystem/index.html index 8c1256a4..e39230b5 100644 --- a/stregsystem/templates/stregsystem/index.html +++ b/stregsystem/templates/stregsystem/index.html @@ -4,9 +4,9 @@ {% load listutil %} {% block title %}TREOENs STREGSYSTEM -{% ifnotequal room.id 1 %} - : {{room.description}} -{% endifnotequal %} +{% if room.id != 1 %} +: {{room.description}} +{% endif %} {% endblock %} {% block content %} diff --git a/stregsystem/templates/stregsystem/ranks.html b/stregsystem/templates/stregsystem/ranks.html index 9dd86ec4..6684dc1f 100644 --- a/stregsystem/templates/stregsystem/ranks.html +++ b/stregsystem/templates/stregsystem/ranks.html @@ -3,9 +3,9 @@ {% load stregsystem_extras %} {% block title %}TREOENs STREGSYSTEM -{% ifnotequal room.id 1 %} +{% if room.id != 1 %} : {{room.description}} -{% endifnotequal %} +{% endif %} {% endblock %} {% block content %} From 00a7b5cf63006494507d66f44957561c2e273ef7 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 08:05:37 +0200 Subject: [PATCH 02/11] Update Black check --- .github/workflows/black.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 7c45d2cb..4731fdc5 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -15,4 +15,4 @@ jobs: - name: Black Code Formatter uses: lgeiger/black-action@v1.0.1 with: - args: --check --target-version py36 --line-length 120 --skip-string-normalization --exclude '(migrations|urls\.py)' stregsystem stregreport kiosk + args: --check --target-version py311 --line-length 120 --skip-string-normalization --exclude '(migrations|urls\.py)' stregsystem stregreport kiosk From f3aab68530ca62d52eee3b557da8223a8396f847 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 08:07:13 +0200 Subject: [PATCH 03/11] Update Python version readme and django action --- .github/workflows/django.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 53a3fcfe..c7145506 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.6.9", "3.7.17", "3.11.5"] # 3.6.9 is what is running on prod + python-version: ["3.10.14", "3.11.5"] # 3.11.5 is what is running on prod steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index be826a7c..d245fa8b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Python Environment For windows using Anaconda and virtual environments: 1. Download and install Anaconda 2. In a shell: - - `conda create -n stregsystem python=3.6` + - `conda create -n stregsystem python=3.11.5` - `activate stregsystem` - `pip install -r requirements.txt` 3. ??? From ef5101fc49e71ec72dd22ddc3dfc6f87501a0d39 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 08:11:56 +0200 Subject: [PATCH 04/11] Add default autofield --- treo/settings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/treo/settings.py b/treo/settings.py index a0f5af18..a3d7c567 100644 --- a/treo/settings.py +++ b/treo/settings.py @@ -16,6 +16,7 @@ from io import StringIO import json +from django.conf.global_settings import DEFAULT_AUTO_FIELD # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -135,6 +136,7 @@ ] WSGI_APPLICATION = 'treo.wsgi.application' +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases From 015ce8a6ae9d9c9550b61205db43b4aa00a0c48d Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 08:12:16 +0200 Subject: [PATCH 05/11] Add protocol to CSRF_ORIGIN --- treo/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/treo/settings.py b/treo/settings.py index a3d7c567..4994f69b 100644 --- a/treo/settings.py +++ b/treo/settings.py @@ -72,7 +72,7 @@ CSRF_COOKIE_SECURE = cfg.getboolean("debug", "CSRF_COOKIE_SECURE") CSRF_COOKIE_HTTPONLY = cfg.getboolean("debug", "CSRF_COOKIE_HTTPONLY") -CSRF_TRUSTED_ORIGINS = ["fappen.fklub.dk"] +CSRF_TRUSTED_ORIGINS = ["https://fappen.fklub.dk"] SESSION_COOKIE_SECURE = cfg.getboolean("debug", "SESSION_COOKIT_SECURE") SECURE_BROWSER_XSS_FILTER = cfg.getboolean("debug", "SECURE_BROWSER_XSS_FILTER") From 83dd88ef2bbd1cb9e65dedfa33aa95400062c70f Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 08:25:23 +0200 Subject: [PATCH 06/11] Update dependencies --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7591d8ac..ec3f7f55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ Django==5.0.2 -Pillow==10.2.0 -Coverage==7.4.3 +Pillow==10.3.0 +Coverage==7.5.1 pytz==2024.1 -freezegun==1.4.0 +freezegun==1.5.1 Django-Select2==8.1.2 django-debug-toolbar==4.3.0 requests==2.31.0 From 395462d4bf44ee3e1a3285e61bef48704445c29b Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 08:25:41 +0200 Subject: [PATCH 07/11] Downgrade Django to 4.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ec3f7f55..957513ab 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django==5.0.2 +Django==4.2.13 Pillow==10.3.0 Coverage==7.5.1 pytz==2024.1 From 2d662ceb81233e68808bd870ea63f0182ae9b09d Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 17:56:35 +0200 Subject: [PATCH 08/11] Fix test failing because new Django version Newer Django changes the exception type from AssertionError -> ValueError --- stregsystem/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stregsystem/tests.py b/stregsystem/tests.py index 705570e8..b2db8a45 100644 --- a/stregsystem/tests.py +++ b/stregsystem/tests.py @@ -676,7 +676,7 @@ def test_payment_delete_already_saved(self, make_payment): def test_payment_delete_not_saved(self, make_payment): payment = Payment(member=self.member, amount=100) - with self.assertRaises(AssertionError): + with self.assertRaises(ValueError): payment.delete() From 01b47a307db122b3f8a7f151bfb2119a41262d43 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 17:59:10 +0200 Subject: [PATCH 09/11] Update python from 3.11.5 -> 3.11.9 --- .github/workflows/django.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index c7145506..8b6641da 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.10.14", "3.11.5"] # 3.11.5 is what is running on prod + python-version: ["3.10.14", "3.11.9"] # 3.11.9 is what is running on prod steps: - uses: actions/checkout@v2 From 4d8366cd829999f5e22953bae1ce36a65cd5a363 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Wed, 15 May 2024 18:01:31 +0200 Subject: [PATCH 10/11] Update readme with new version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d245fa8b..e9c90b7b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Python Environment For windows using Anaconda and virtual environments: 1. Download and install Anaconda 2. In a shell: - - `conda create -n stregsystem python=3.11.5` + - `conda create -n stregsystem python=3.11.9` - `activate stregsystem` - `pip install -r requirements.txt` 3. ??? From 8ae4403c1769076369f11d5d52b259fc3f9f9da8 Mon Sep 17 00:00:00 2001 From: Kresten Laust Date: Fri, 17 May 2024 17:15:41 +0200 Subject: [PATCH 11/11] Remove patch from Anaconda version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e9c90b7b..264d3824 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Python Environment For windows using Anaconda and virtual environments: 1. Download and install Anaconda 2. In a shell: - - `conda create -n stregsystem python=3.11.9` + - `conda create -n stregsystem python=3.11` - `activate stregsystem` - `pip install -r requirements.txt` 3. ???