diff --git a/.env_example b/.env_example index 7e1dbd3b..da0b4efa 100644 --- a/.env_example +++ b/.env_example @@ -21,3 +21,6 @@ EMAIL_PASSWORD=CHANGE_ME # Wiki configuration WIKI_USER=NoteKfet2020 WIKI_PASSWORD= + +# OIDC +OIDC_RSA_PRIVATE_KEY=CHANGE_ME diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2ba35d31..4cf8dab9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,7 +8,7 @@ variables: GIT_SUBMODULE_STRATEGY: recursive # Ubuntu 22.04 -py310-django42: +py310-django52: stage: test image: ubuntu:22.04 before_script: @@ -22,10 +22,10 @@ py310-django42: python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache python3-bs4 python3-setuptools tox texlive-xetex - script: tox -e py310-django42 + script: tox -e py310-django52 # Debian Bookworm -py311-django42: +py311-django52: stage: test image: debian:bookworm before_script: @@ -37,7 +37,7 @@ py311-django42: python3-djangorestframework python3-django-oauth-toolkit python3-psycopg2 python3-pil python3-babel python3-lockfile python3-pip python3-phonenumbers python3-memcache python3-bs4 python3-setuptools tox texlive-xetex - script: tox -e py311-django42 + script: tox -e py311-django52 linters: stage: quality-assurance diff --git a/README.md b/README.md index 4ba19356..c340d58c 100644 --- a/README.md +++ b/README.md @@ -61,8 +61,8 @@ Bien que cela permette de créer une instance sur toutes les distributions, 6. (Optionnel) **Création d'une clé privée OpenID Connect** Pour activer le support d'OpenID Connect, il faut générer une clé privée, par -exemple avec openssl (`openssl genrsa -out oidc.key 4096`), et renseigner son -emplacement dans `OIDC_RSA_PRIVATE_KEY` (par défaut `/var/secrets/oidc.key`). +exemple avec openssl (`openssl genrsa -out oidc.key 4096`), et copier la clé dans .env dans le champ +`OIDC_RSA_PRIVATE_KEY`. 7. Enjoy : @@ -237,8 +237,8 @@ Sinon vous pouvez suivre les étapes décrites ci-dessous. 7. **Création d'une clé privée OpenID Connect** Pour activer le support d'OpenID Connect, il faut générer une clé privée, par -exemple avec openssl (`openssl genrsa -out oidc.key 4096`), et renseigner son -emplacement dans `OIDC_RSA_PRIVATE_KEY` (par défaut `/var/secrets/oidc.key`). +exemple avec openssl (`openssl genrsa -out oidc.key 4096`), et renseigner le champ +`OIDC_RSA_PRIVATE_KEY` dans le .env (par défaut `/var/secrets/oidc.key`). 8. *Enjoy \o/* diff --git a/apps/activity/forms.py b/apps/activity/forms.py index 305c4f03..a865ece6 100644 --- a/apps/activity/forms.py +++ b/apps/activity/forms.py @@ -32,7 +32,7 @@ class ActivityForm(forms.ModelForm): def clean_organizer(self): organizer = self.cleaned_data['organizer'] if not organizer.note.is_active: - self.add_error('organiser', _('The note of this club is inactive.')) + self.add_error('organizer', _('The note of this club is inactive.')) return organizer def clean_date_end(self): diff --git a/apps/activity/migrations/0007_alter_guest_activity.py b/apps/activity/migrations/0007_alter_guest_activity.py new file mode 100644 index 00000000..9badcc1b --- /dev/null +++ b/apps/activity/migrations/0007_alter_guest_activity.py @@ -0,0 +1,19 @@ +# Generated by Django 4.2.20 on 2025-05-08 19:07 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('activity', '0006_guest_school'), + ] + + operations = [ + migrations.AlterField( + model_name='guest', + name='activity', + field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='activity.activity'), + ), + ] diff --git a/apps/activity/models.py b/apps/activity/models.py index c7c92e8d..4e313a57 100644 --- a/apps/activity/models.py +++ b/apps/activity/models.py @@ -234,7 +234,7 @@ class Guest(models.Model): """ activity = models.ForeignKey( Activity, - on_delete=models.PROTECT, + on_delete=models.CASCADE, related_name='+', ) diff --git a/apps/activity/templates/activity/activity_detail.html b/apps/activity/templates/activity/activity_detail.html index a94d1e37..bb0fc57a 100644 --- a/apps/activity/templates/activity/activity_detail.html +++ b/apps/activity/templates/activity/activity_detail.html @@ -37,6 +37,11 @@ SPDX-License-Identifier: GPL-3.0-or-later
| + {% trans "Name" %} + | ++ {% trans "Owner" %} + | ++ {% trans "Expiry date" %} + | +
|---|---|---|
| {{ food.name }} | +{{ food.owner }} | +{{ food.expiry_date }} | +
{% trans 'Name' %} : {{ qrcode.food_container.name }}
{% trans 'Owner' %} : {{ qrcode.food_container.owner }}
{% trans 'Expiry date' %} : {{ qrcode.food_container.expiry_date }}
{% trans 'Owner' %} : {{ food.owner }}
{% trans 'Ready' %} : {{ food.is_ready }}
{% trans 'Creation date' %} : {{ food.creation_date }}
{% trans 'Expiry date' %} : {{ food.expiry_date }}
-
-
{% trans 'Shelf life' %} : {{ food.shelf_life }}
{% trans 'Ready' %} : {{ food.is_ready }}
{% trans 'Active' %} : {{ food.is_active }}
{% trans 'Eaten' %} : {{ food.was_eaten }}
{% blocktrans trimmed with balance=registration.user.note.balance|pretty_money %} + Current balance: {{ balance }} + {% endblocktrans %}
+Default content...
@@ -215,6 +234,10 @@ SPDX-License-Identifier: GPL-3.0-or-later class="text-muted">{% trans "Charte Info (FR)" %} — {% trans "FAQ (FR)" %} — + {% trans "Managed by BDE" %} — + {% trans "Hosted by Cr@ns" %} — {% csrf_token %}