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 diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 53a3fcfe..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.6.9", "3.7.17", "3.11.5"] # 3.6.9 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 diff --git a/README.md b/README.md index be826a7c..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.6` + - `conda create -n stregsystem python=3.11` - `activate stregsystem` - `pip install -r requirements.txt` 3. ??? diff --git a/requirements.txt b/requirements.txt index 734276b8..957513ab 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==4.2.13 +Pillow==10.3.0 +Coverage==7.5.1 +pytz==2024.1 +freezegun==1.5.1 +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 15501b0e..24181c9b 100644 --- a/stregsystem/templates/stregsystem/base.html +++ b/stregsystem/templates/stregsystem/base.html @@ -36,9 +36,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 df4ef2f2..edc5c572 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 %} 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() diff --git a/treo/settings.py b/treo/settings.py index a0f5af18..4994f69b 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__))) @@ -71,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") @@ -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