mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-30 23:39:54 +01:00 
			
		
		
		
	Compare commits
	
		
			96 Commits
		
	
	
		
			fix_activi
			...
			9252d0ef6a
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 9252d0ef6a | ||
|  | ff4353d344 | ||
|  | a90f45bd8b | ||
|  | 10c22ccc53 | ||
|  | 6969cee0f3 | ||
|  | ddeada200b | ||
|  | 8e2b24b2da | ||
|  | bd76c280ec | ||
|  | ca0a95ba9e | ||
|  | 614f76e699 | ||
|  | a5815f0bc7 | ||
|  | 84e9fea15f | ||
|  | b7a660ee40 | ||
|  | b9ebb1718a | ||
|  | 7ba5c76a89 | ||
|  | 702ddb5679 | ||
|  | 93aed87265 | ||
|  | 60355196ce | ||
|  | 9bffb32a5e | ||
|  | 5ef019c5c2 | ||
|  | 8da62e62fb | ||
|  | 56a43396d4 | ||
|  | 7966d6f397 | ||
|  | cb61c511ce | ||
|  | 25bfa575ed | ||
|  | e21d9fcfbe | ||
|  | b293904525 | ||
|  | bd7e6b8ad4 | ||
|  | a208a4fa25 | ||
|  | 4799b2c52d | ||
|  | 562dcfb908 | ||
|  | 12ef258ff0 | ||
|  | 2ae32ee3b6 | ||
|  | ec1bd45481 | ||
|  | 370a9a069e | ||
|  | 7f0a3784e9 | ||
|  | 36f4adf2e7 | ||
|  | ae7d5d5489 | ||
|  | 434097aba4 | ||
|  | a0ebf8658d | ||
|  | 423454ba5d | ||
|  | 3ccb31639c | ||
|  | 5fb12a1388 | ||
|  | fe029893b0 | ||
|  | 767e98c2a3 | ||
|  | 1bdad76fe9 | ||
|  | 0196db7fff | ||
|  | 1f53ad4407 | ||
|  | 018f6e3f13 | ||
|  | 9752a030d9 | ||
|  | b27bdb090d | ||
|  | 55a0fbb6cb | ||
|  | c356534309 | ||
|  | 51315a0555 | ||
|  | e5f9fe2cf5 | ||
|  | 6c63c6417c | ||
|  | 4563b2b640 | ||
|  | c630a3fbd5 | ||
|  | 79b8ebeca4 | ||
|  | dc14ba0101 | ||
|  | 6028bfeb56 | ||
|  | bd9773a8af | ||
|  | cdeb76d9f8 | ||
|  | ac4574200d | ||
|  | b17d31e8ee | ||
|  | 30d27459dd | ||
|  | 333f7aa284 | ||
|  | 587314e03c | ||
|  | 9f888a5281 | ||
|  | 88b1a25ca0 | ||
|  | 8cb50f58f2 | ||
|  | 041a8f20a9 | ||
|  | b1ffb28532 | ||
|  | 6225fb51f1 | ||
|  | 1dd74e8024 | ||
|  | 1af9f5f23c | ||
|  | 83d5a7ceff | ||
|  | a7cba0a4a3 | ||
|  | ccd9a66ab9 | ||
|  | c7a92fa4b2 | ||
|  | 5f1b698d58 | ||
|  | 0a5368d23f | ||
|  | 26b351a51c | ||
|  | 1836677c47 | ||
|  | e7a98c86f0 | ||
|  | eb5044490b | ||
|  | 983d7ec052 | ||
|  | dc56deaf85 | ||
|  | 19d1ecfc66 | ||
|  | 694f54e1c4 | ||
|  | b0c3eee699 | ||
|  | cd942779ca | ||
|  | 7ed544b3ac | ||
|  | 5a0fe7a6f0 | ||
|  | eda8460014 | ||
|  | 15c71ad31a | 
							
								
								
									
										16
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								README.md
									
									
									
									
									
								
							| @@ -58,7 +58,13 @@ Bien que cela permette de créer une instance sur toutes les distributions, | |||||||
|     (env)$ ./manage.py createsuperuser  # Création d'un⋅e utilisateur⋅rice initial |     (env)$ ./manage.py createsuperuser  # Création d'un⋅e utilisateur⋅rice initial | ||||||
|     ``` |     ``` | ||||||
|  |  | ||||||
| 6.  Enjoy : | 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`). | ||||||
|  |  | ||||||
|  | 7.  Enjoy : | ||||||
|  |  | ||||||
|     ```bash |     ```bash | ||||||
|     (env)$ ./manage.py runserver 0.0.0.0:8000 |     (env)$ ./manage.py runserver 0.0.0.0:8000 | ||||||
| @@ -228,7 +234,13 @@ Sinon vous pouvez suivre les étapes décrites ci-dessous. | |||||||
|         (env)$ ./manage.py check # pas de bêtise qui traine |         (env)$ ./manage.py check # pas de bêtise qui traine | ||||||
|         (env)$ ./manage.py migrate |         (env)$ ./manage.py migrate | ||||||
|  |  | ||||||
| 7.  *Enjoy \o/* | 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`). | ||||||
|  |  | ||||||
|  | 8.  *Enjoy \o/* | ||||||
|  |  | ||||||
| ### Installation avec Docker | ### Installation avec Docker | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'activity.apps.ActivityConfig' | default_app_config = 'activity.apps.ActivityConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
| @@ -35,7 +35,7 @@ class GuestAdmin(admin.ModelAdmin): | |||||||
|     """ |     """ | ||||||
|     Admin customisation for Guest |     Admin customisation for Guest | ||||||
|     """ |     """ | ||||||
|     list_display = ('last_name', 'first_name', 'activity', 'inviter') |     list_display = ('last_name', 'first_name', 'school', 'activity', 'inviter') | ||||||
|     form = GuestForm |     form = GuestForm | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.utils.translation import gettext_lazy as _ | from django.utils.translation import gettext_lazy as _ | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .views import ActivityTypeViewSet, ActivityViewSet, EntryViewSet, GuestViewSet, OpenerViewSet | from .views import ActivityTypeViewSet, ActivityViewSet, EntryViewSet, GuestViewSet, OpenerViewSet | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from api.filters import RegexSafeSearchFilter | from api.filters import RegexSafeSearchFilter | ||||||
| @@ -51,9 +51,9 @@ class GuestViewSet(ReadProtectedModelViewSet): | |||||||
|     queryset = Guest.objects.order_by('id') |     queryset = Guest.objects.order_by('id') | ||||||
|     serializer_class = GuestSerializer |     serializer_class = GuestSerializer | ||||||
|     filter_backends = [DjangoFilterBackend, RegexSafeSearchFilter] |     filter_backends = [DjangoFilterBackend, RegexSafeSearchFilter] | ||||||
|     filterset_fields = ['activity', 'activity__name', 'last_name', 'first_name', 'inviter', 'inviter__alias__name', |     filterset_fields = ['activity', 'activity__name', 'last_name', 'first_name', 'school', 'inviter', 'inviter__alias__name', | ||||||
|                         'inviter__alias__normalized_name', ] |                         'inviter__alias__normalized_name', ] | ||||||
|     search_fields = ['$activity__name', '$last_name', '$first_name', '$inviter__user__email', '$inviter__alias__name', |     search_fields = ['$activity__name', '$last_name', '$first_name', '$school', '$inviter__user__email', '$inviter__alias__name', | ||||||
|                      '$inviter__alias__normalized_name', ] |                      '$inviter__alias__normalized_name', ] | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import timedelta | from datetime import timedelta | ||||||
| @@ -107,7 +107,7 @@ class GuestForm(forms.ModelForm): | |||||||
|  |  | ||||||
|     class Meta: |     class Meta: | ||||||
|         model = Guest |         model = Guest | ||||||
|         fields = ('last_name', 'first_name', 'inviter', ) |         fields = ('last_name', 'first_name', 'school', 'inviter', ) | ||||||
|         widgets = { |         widgets = { | ||||||
|             "inviter": Autocomplete( |             "inviter": Autocomplete( | ||||||
|                 NoteUser, |                 NoteUser, | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								apps/activity/migrations/0006_guest_school.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								apps/activity/migrations/0006_guest_school.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | # Generated by Django 4.2.20 on 2025-03-25 09:58 | ||||||
|  |  | ||||||
|  | from django.db import migrations, models | ||||||
|  |  | ||||||
|  |  | ||||||
|  | class Migration(migrations.Migration): | ||||||
|  |     dependencies = [ | ||||||
|  |         ("activity", "0005_alter_opener_options_alter_opener_opener"), | ||||||
|  |     ] | ||||||
|  |  | ||||||
|  |     operations = [ | ||||||
|  |         migrations.AddField( | ||||||
|  |             model_name="guest", | ||||||
|  |             name="school", | ||||||
|  |             field=models.CharField(default="", max_length=255, verbose_name="school"), | ||||||
|  |             preserve_default=False, | ||||||
|  |         ), | ||||||
|  |     ] | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import os | import os | ||||||
| @@ -201,7 +201,8 @@ class Entry(models.Model): | |||||||
|     def save(self, *args, **kwargs): |     def save(self, *args, **kwargs): | ||||||
|         qs = Entry.objects.filter(~Q(pk=self.pk), activity=self.activity, note=self.note, guest=self.guest) |         qs = Entry.objects.filter(~Q(pk=self.pk), activity=self.activity, note=self.note, guest=self.guest) | ||||||
|         if qs.exists(): |         if qs.exists(): | ||||||
|             raise ValidationError(_("Already entered on ") + _("{:%Y-%m-%d %H:%M:%S}").format(qs.get().time, )) |             raise ValidationError(_("Already entered on ") | ||||||
|  |                                   + _("{:%Y-%m-%d %H:%M:%S}").format(timezone.localtime(qs.get().time), )) | ||||||
|  |  | ||||||
|         if self.guest: |         if self.guest: | ||||||
|             self.note = self.guest.inviter |             self.note = self.guest.inviter | ||||||
| @@ -247,6 +248,11 @@ class Guest(models.Model): | |||||||
|         verbose_name=_("first name"), |         verbose_name=_("first name"), | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
|  |     school = models.CharField( | ||||||
|  |         max_length=255, | ||||||
|  |         verbose_name=_("school"), | ||||||
|  |     ) | ||||||
|  |  | ||||||
|     inviter = models.ForeignKey( |     inviter = models.ForeignKey( | ||||||
|         NoteUser, |         NoteUser, | ||||||
|         on_delete=models.PROTECT, |         on_delete=models.PROTECT, | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.utils import timezone | from django.utils import timezone | ||||||
| @@ -51,11 +51,11 @@ class GuestTable(tables.Table): | |||||||
|         } |         } | ||||||
|         model = Guest |         model = Guest | ||||||
|         template_name = 'django_tables2/bootstrap4.html' |         template_name = 'django_tables2/bootstrap4.html' | ||||||
|         fields = ("last_name", "first_name", "inviter", ) |         fields = ("last_name", "first_name", "inviter", "school") | ||||||
|  |  | ||||||
|     def render_entry(self, record): |     def render_entry(self, record): | ||||||
|         if record.has_entry: |         if record.has_entry: | ||||||
|             return str(_("Entered on ") + str(_("{:%Y-%m-%d %H:%M:%S}").format(record.entry.time, ))) |             return str(_("Entered on ") + str(_("{:%Y-%m-%d %H:%M:%S}").format(timezone.localtime(record.entry.time)))) | ||||||
|         return mark_safe('<button id="{id}" class="btn btn-danger btn-sm" onclick="remove_guest(this.id)"> ' |         return mark_safe('<button id="{id}" class="btn btn-danger btn-sm" onclick="remove_guest(this.id)"> ' | ||||||
|                          '{delete_trans}</button>'.format(id=record.id, delete_trans=_("remove").capitalize())) |                          '{delete_trans}</button>'.format(id=record.id, delete_trans=_("remove").capitalize())) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import timedelta | from datetime import timedelta | ||||||
| @@ -50,6 +50,7 @@ class TestActivities(TestCase): | |||||||
|             inviter=self.user.note, |             inviter=self.user.note, | ||||||
|             last_name="GUEST", |             last_name="GUEST", | ||||||
|             first_name="Guest", |             first_name="Guest", | ||||||
|  |             school="School", | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|     def test_activity_list(self): |     def test_activity_list(self): | ||||||
| @@ -156,6 +157,7 @@ class TestActivities(TestCase): | |||||||
|             inviter=self.user.note.id, |             inviter=self.user.note.id, | ||||||
|             last_name="GUEST2", |             last_name="GUEST2", | ||||||
|             first_name="Guest", |             first_name="Guest", | ||||||
|  |             school="School", | ||||||
|         )) |         )) | ||||||
|         self.assertEqual(response.status_code, 200) |         self.assertEqual(response.status_code, 200) | ||||||
|  |  | ||||||
| @@ -167,6 +169,7 @@ class TestActivities(TestCase): | |||||||
|             inviter=self.user.note.id, |             inviter=self.user.note.id, | ||||||
|             last_name="GUEST2", |             last_name="GUEST2", | ||||||
|             first_name="Guest", |             first_name="Guest", | ||||||
|  |             school="School", | ||||||
|         )) |         )) | ||||||
|         self.assertRedirects(response, reverse("activity:activity_detail", args=(self.activity.pk,)), 302, 200) |         self.assertRedirects(response, reverse("activity:activity_detail", args=(self.activity.pk,)), 302, 200) | ||||||
|  |  | ||||||
| @@ -200,6 +203,7 @@ class TestActivityAPI(TestAPI): | |||||||
|             inviter=self.user.note, |             inviter=self.user.note, | ||||||
|             last_name="GUEST", |             last_name="GUEST", | ||||||
|             first_name="Guest", |             first_name="Guest", | ||||||
|  |             school="School", | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|         self.entry = Entry.objects.create( |         self.entry = Entry.objects.create( | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.urls import path | from django.urls import path | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from hashlib import md5 | from hashlib import md5 | ||||||
| @@ -168,6 +168,7 @@ class ActivityInviteView(ProtectQuerysetMixin, ProtectedCreateView): | |||||||
|             activity=activity, |             activity=activity, | ||||||
|             first_name="", |             first_name="", | ||||||
|             last_name="", |             last_name="", | ||||||
|  |             school="", | ||||||
|             inviter=self.request.user.note, |             inviter=self.request.user.note, | ||||||
|         ) |         ) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'api.apps.APIConfig' | default_app_config = 'api.apps.APIConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import json | import json | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
| @@ -47,6 +47,10 @@ if "wei" in settings.INSTALLED_APPS: | |||||||
|     from wei.api.urls import register_wei_urls |     from wei.api.urls import register_wei_urls | ||||||
|     register_wei_urls(router, 'wei') |     register_wei_urls(router, 'wei') | ||||||
|  |  | ||||||
|  | if "wrapped" in settings.INSTALLED_APPS: | ||||||
|  |     from wrapped.api.urls import register_wrapped_urls | ||||||
|  |     register_wrapped_urls(router, 'wrapped') | ||||||
|  |  | ||||||
| app_name = 'api' | app_name = 'api' | ||||||
|  |  | ||||||
| # Wire up our API using automatic URL routing. | # Wire up our API using automatic URL routing. | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib.auth.models import User | from django.contrib.auth.models import User | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import re | import re | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from rest_framework import serializers | from rest_framework import serializers | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .views import AllergenViewSet, BasicFoodViewSet, QRCodeViewSet, TransformedFoodViewSet | from .views import AllergenViewSet, BasicFoodViewSet, QRCodeViewSet, TransformedFoodViewSet | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from api.viewsets import ReadProtectedModelViewSet | from api.viewsets import ReadProtectedModelViewSet | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from random import shuffle | from random import shuffle | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import timedelta | from datetime import timedelta | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import django_tables2 as tables | import django_tables2 as tables | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.urls import path | from django.urls import path | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.db import transaction | from django.db import transaction | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'logs.apps.LogsConfig' | default_app_config = 'logs.apps.LogsConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from rest_framework import serializers | from rest_framework import serializers | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .views import ChangelogViewSet | from .views import ChangelogViewSet | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django_filters.rest_framework import DjangoFilterBackend | from django_filters.rest_framework import DjangoFilterBackend | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib.contenttypes.models import ContentType | from django.contrib.contenttypes.models import ContentType | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'member.apps.MemberConfig' | default_app_config = 'member.apps.MemberConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from rest_framework import serializers | from rest_framework import serializers | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .views import ProfileViewSet, ClubViewSet, MembershipViewSet | from .views import ProfileViewSet, ClubViewSet, MembershipViewSet | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django_filters.rest_framework import DjangoFilterBackend | from django_filters.rest_framework import DjangoFilterBackend | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from cas_server.auth import DjangoAuthUser  # pragma: no cover | from cas_server.auth import DjangoAuthUser  # pragma: no cover | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import io | import io | ||||||
| @@ -23,7 +23,7 @@ from .models import Profile, Club, Membership | |||||||
| class CustomAuthenticationForm(AuthenticationForm): | class CustomAuthenticationForm(AuthenticationForm): | ||||||
|     permission_mask = forms.ModelChoiceField( |     permission_mask = forms.ModelChoiceField( | ||||||
|         label=_("Permission mask"), |         label=_("Permission mask"), | ||||||
|         queryset=PermissionMask.objects.order_by("rank"), |         queryset=PermissionMask.objects.order_by("-rank"), | ||||||
|         empty_label=None, |         empty_label=None, | ||||||
|     ) |     ) | ||||||
|  |  | ||||||
| @@ -45,7 +45,7 @@ class ProfileForm(forms.ModelForm): | |||||||
|     A form for the extras field provided by the :model:`member.Profile` model. |     A form for the extras field provided by the :model:`member.Profile` model. | ||||||
|     """ |     """ | ||||||
|     # Remove widget=forms.HiddenInput() if you want to use report frequency. |     # Remove widget=forms.HiddenInput() if you want to use report frequency. | ||||||
|     report_frequency = forms.IntegerField(required=False, initial=0, label=_("Report frequency"), widget=forms.HiddenInput()) |     report_frequency = forms.IntegerField(required=False, initial=0, label=_("Report frequency")) | ||||||
|  |  | ||||||
|     last_report = forms.DateTimeField(required=False, disabled=True, label=_("Last report date")) |     last_report = forms.DateTimeField(required=False, disabled=True, label=_("Last report date")) | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import hashlib | import hashlib | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								apps/member/migrations/0013_auto_20240807_1409.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								apps/member/migrations/0013_auto_20240807_1409.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | # Generated by Django 2.2.28 on 2024-08-07 12:09 | ||||||
|  |  | ||||||
|  | from django.db import migrations, models | ||||||
|  |  | ||||||
|  |  | ||||||
|  | class Migration(migrations.Migration): | ||||||
|  |  | ||||||
|  |     dependencies = [ | ||||||
|  |         ('member', '0012_club_add_registration_form'), | ||||||
|  |     ] | ||||||
|  |  | ||||||
|  |     operations = [ | ||||||
|  |         migrations.AlterField( | ||||||
|  |             model_name='profile', | ||||||
|  |             name='promotion', | ||||||
|  |             field=models.PositiveSmallIntegerField(default=2024, help_text='Year of entry to the school (None if not ENS student)', null=True, verbose_name='promotion'), | ||||||
|  |         ), | ||||||
|  |     ] | ||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import datetime | import datetime | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import date | from datetime import date | ||||||
|   | |||||||
| @@ -20,11 +20,13 @@ SPDX-License-Identifier: GPL-3.0-or-later | |||||||
|       </form> |       </form> | ||||||
|     </div> |     </div> | ||||||
|     <!-- MODAL TO CROP THE IMAGE --> |     <!-- MODAL TO CROP THE IMAGE --> | ||||||
|     <div class="modal fade" id="modalCrop"> |     <div class="modal fade" id="modalCrop" data-backdrop="static"> | ||||||
|       <div class="modal-dialog"> |       <div class="modal-dialog"> | ||||||
|         <div class="modal-content"> |         <div class="modal-content"> | ||||||
|           <div class="modal-body"> |             <div class="modal-body-wrapper" style="width: 500px; height: 500px; padding: 16px;"> | ||||||
|             <img src="" id="modal-image" style="max-width: 100%;"> |               <div class="modal-body" style="width: 100%; height: 100%; padding: 0"> | ||||||
|  |                 <img src="" id="modal-image" style="display: block; max-width: 100%;"> | ||||||
|  |               </div> | ||||||
|             </div> |             </div> | ||||||
|           <div class="modal-footer"> |           <div class="modal-footer"> | ||||||
|             <div class="btn-group pull-left" role="group"> |             <div class="btn-group pull-left" role="group"> | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import date | from datetime import date | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.urls import path | from django.urls import path | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import timedelta, date | from datetime import timedelta, date | ||||||
| @@ -26,6 +26,7 @@ from note_kfet.middlewares import _set_current_request | |||||||
| from permission.backends import PermissionBackend | from permission.backends import PermissionBackend | ||||||
| from permission.models import Role | from permission.models import Role | ||||||
| from permission.views import ProtectQuerysetMixin, ProtectedCreateView | from permission.views import ProtectQuerysetMixin, ProtectedCreateView | ||||||
|  | from django import forms | ||||||
|  |  | ||||||
| from .forms import UserForm, ProfileForm, ImageForm, ClubForm, MembershipForm, \ | from .forms import UserForm, ProfileForm, ImageForm, ClubForm, MembershipForm, \ | ||||||
|     CustomAuthenticationForm, MembershipRolesForm |     CustomAuthenticationForm, MembershipRolesForm | ||||||
| @@ -72,11 +73,24 @@ class UserUpdateView(ProtectQuerysetMixin, LoginRequiredMixin, UpdateView): | |||||||
|         form.fields['email'].required = True |         form.fields['email'].required = True | ||||||
|         form.fields['email'].help_text = _("This address must be valid.") |         form.fields['email'].help_text = _("This address must be valid.") | ||||||
|  |  | ||||||
|         if PermissionBackend.check_perm(self.request, "member.change_profile", context['user_object'].profile): |         profile_form = self.profile_form(instance=context['user_object'].profile, | ||||||
|             context['profile_form'] = self.profile_form(instance=context['user_object'].profile, |  | ||||||
|                                          data=self.request.POST if self.request.POST else None) |                                          data=self.request.POST if self.request.POST else None) | ||||||
|  |  | ||||||
|         if not self.object.profile.report_frequency: |         if not self.object.profile.report_frequency: | ||||||
|                 del context['profile_form'].fields["last_report"] |             del profile_form.fields["last_report"] | ||||||
|  |  | ||||||
|  |         fields_to_check = list(profile_form.fields.keys()) | ||||||
|  |         fields_modifiable = False | ||||||
|  |  | ||||||
|  |         # Delete the fields for which the user does not have the permission to modify | ||||||
|  |         for field_name in fields_to_check: | ||||||
|  |             if not PermissionBackend.check_perm(self.request, f"member.change_profile_{field_name}", context['user_object'].profile): | ||||||
|  |                 profile_form.fields[field_name].widget = forms.HiddenInput() | ||||||
|  |             else: | ||||||
|  |                 fields_modifiable = True | ||||||
|  |  | ||||||
|  |         if fields_modifiable: | ||||||
|  |             context['profile_form'] = profile_form | ||||||
|  |  | ||||||
|         return context |         return context | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'note.apps.NoteConfig' | default_app_config = 'note.apps.NoteConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .views import NotePolymorphicViewSet, AliasViewSet, ConsumerViewSet, \ | from .views import NotePolymorphicViewSet, AliasViewSet, ConsumerViewSet, \ | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
| from datetime import datetime | from datetime import datetime | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .notes import Alias, Note, NoteClub, NoteSpecial, NoteUser, Trust | from .notes import Alias, Note, NoteClub, NoteSpecial, NoteUser, Trust | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import unicodedata | import unicodedata | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.core.exceptions import ValidationError | from django.core.exceptions import ValidationError | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.utils import timezone | from django.utils import timezone | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| // Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | // Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| // SPDX-License-Identifier: GPL-3.0-or-later | // SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| // When a transaction is performed, lock the interface to prevent spam clicks. | // When a transaction is performed, lock the interface to prevent spam clicks. | ||||||
| @@ -245,7 +245,7 @@ function consume (source, source_alias, dest, quantity, amount, reason, type, ca | |||||||
|           invalidity_reason: 'Solde insuffisant', |           invalidity_reason: 'Solde insuffisant', | ||||||
|           polymorphic_ctype: type, |           polymorphic_ctype: type, | ||||||
|           resourcetype: 'RecurrentTransaction', |           resourcetype: 'RecurrentTransaction', | ||||||
|           source: source, |           source: source.id, | ||||||
|           source_alias: source_alias, |           source_alias: source_alias, | ||||||
|           destination: dest, |           destination: dest, | ||||||
|           template: template |           template: template | ||||||
| @@ -294,3 +294,10 @@ searchbar.addEventListener("keyup", function (e) { | |||||||
|   if (firstMatch && e.key === "Enter") |   if (firstMatch && e.key === "Enter") | ||||||
|     firstMatch.click() |     firstMatch.click() | ||||||
| }); | }); | ||||||
|  |  | ||||||
|  | function createshiny() { | ||||||
|  |   const list_btn = document.querySelectorAll('.btn-outline-dark') | ||||||
|  |   const shiny_class = list_btn[Math.floor(Math.random() * list_btn.length)].classList | ||||||
|  |   shiny_class.replace('btn-outline-dark', 'btn-outline-dark-shiny') | ||||||
|  | } | ||||||
|  | createshiny() | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import html | import html | ||||||
|   | |||||||
							
								
								
									
										65
									
								
								apps/note/templates/note/mails/summary_notes_report.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										65
									
								
								apps/note/templates/note/mails/summary_notes_report.html
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,65 @@ | |||||||
|  | {% load pretty_money %} | ||||||
|  | {% load i18n %} | ||||||
|  |  | ||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="fr"> | ||||||
|  | <head> | ||||||
|  |     <meta charset="UTF-8"> | ||||||
|  |     <title>[Note Kfet] Récapitulatif de trésorerie</title> | ||||||
|  | </head> | ||||||
|  | <body> | ||||||
|  | <h1> | ||||||
|  |   Récapitulatif de trésorerie au {{ summary.date|date:"d/m/Y" }} à {{ summary.date|date:"H:i:s" }} : | ||||||
|  | </h1> | ||||||
|  |  | ||||||
|  | <h2> | ||||||
|  |   Tous les utilisateur⋅rices : | ||||||
|  | </h2> | ||||||
|  | <ul> | ||||||
|  |   <li>Positifs : {{ summary.total_positive_user }} soit {{ summary.balance_positive_user / 100 }} €</li> | ||||||
|  |   <li>Neutres : {{ summary.total_zero_user }}</li> | ||||||
|  |   <li>Négatifs : {{ summary.total_negative_user }} soit {{ summary.balance_negative_user / 100 }} €</li> | ||||||
|  | </ul> | ||||||
|  |  | ||||||
|  | <h2> | ||||||
|  |   Les {{ summary.total_positive_user_bde + summary.total_zero_user_bde + summary.total_negative_user_bde }} adhérent⋅es BDE : | ||||||
|  | </h2> | ||||||
|  | <ul> | ||||||
|  |   <li>Positifs : {{ summary.total_positive_user_bde }} soit {{ summary.balance_positive_user_bde / 100 }} €</li> | ||||||
|  |   <li>Neutres : {{ summary.total_zero_user_bde }}</li> | ||||||
|  |   <li>Négatifs : {{ summary.total_negative_user_bde }} soit {{ summary.balance_negative_user_bde / 100 }} €</li> | ||||||
|  | </ul> | ||||||
|  |  | ||||||
|  | <h2> | ||||||
|  |   Clubs : | ||||||
|  | </h2> | ||||||
|  | <ul> | ||||||
|  |   <li>Positifs : {{ summary.total_positive_club }} soit {{ summary.balance_positive_club / 100 }} €</li> | ||||||
|  |   <li>Neutres : {{ summary.total_zero_club }}</li> | ||||||
|  |   <li>Négatifs : {{ summary.total_negative_club }} soit {{ summary.balance_negative_club / 100 }} €</li> | ||||||
|  | </ul> | ||||||
|  |  | ||||||
|  | <h2> | ||||||
|  |   Clubs hors BDE / Kfet et club dont le nom fini par "- BDE" : | ||||||
|  | </h2> | ||||||
|  | <ul> | ||||||
|  |   <li>Positifs : {{ summary.total_positive_club_nbde }} soit {{ summary.balance_positive_club_nbde / 100 }} €</li> | ||||||
|  |   <li>Neutres : {{ summary.total_zero_club_nbde }}</li> | ||||||
|  |   <li>Négatifs : {{ summary.total_negative_club_nbde }} soit {{ summary.balance_negative_club_nbde / 100 }} €</li> | ||||||
|  | </ul> | ||||||
|  |  | ||||||
|  | <h2> | ||||||
|  |   Progression : | ||||||
|  | </h2> | ||||||
|  | <ul> | ||||||
|  |   <li>Ceci correspond à une différence de {{ balance_difference_user / 100 }} € pour les utilisateur⋅rices</li> | ||||||
|  |   <li>Ceci correspond à une différence de {{ balance_difference_club / 100 }} € pour les clubs</li> | ||||||
|  | </ul> | ||||||
|  |  | ||||||
|  | -- | ||||||
|  | <p> | ||||||
|  |     Le BDE<br> | ||||||
|  |     {% trans "Mail generated by the Note Kfet on the" %} {% now "j F Y à H:i:s" %} | ||||||
|  | </p> | ||||||
|  | </body> | ||||||
|  | </html> | ||||||
							
								
								
									
										33
									
								
								apps/note/templates/note/mails/summary_notes_report.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								apps/note/templates/note/mails/summary_notes_report.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | |||||||
|  | {% load pretty_money %} | ||||||
|  | {% load i18n %} | ||||||
|  |  | ||||||
|  | Récapitulatif de trésorerie au {{ summary.date|date:"d/m/Y" }} à {{ summary.date|date:"H:i:s" }} : | ||||||
|  |  | ||||||
|  | Tous les utilisateur⋅rices : | ||||||
|  |   - Positifs : {{ summary.total_positive_user }} soit {{ summary.balance_positive_user / 100 }} € | ||||||
|  |   - Neutres : {{ summary.total_zero_user }} | ||||||
|  |   - Négatifs : {{ summary.total_negative_user }} soit {{ summary.balance_negative_user / 100 }} € | ||||||
|  |  | ||||||
|  | Les {{ summary.total_positive_user_bde + summary.total_zero_user_bde + summary.total_negative_user_bde }} adhérent⋅es BDE : | ||||||
|  |   - Positifs : {{ summary.total_positive_user_bde }} soit {{ summary.balance_positive_user_bde / 100 }} € | ||||||
|  |   - Neutres : {{ summary.total_zero_user_bde }} | ||||||
|  |   - Négatifs : {{ summary.total_negative_user_bde }} soit {{ summary.balance_negative_user_bde /100 }} € | ||||||
|  |  | ||||||
|  | Clubs : | ||||||
|  |   - Positifs : {{ summary.total_positive_club }} soit {{ summary.balance_positive_club / 100 }} € | ||||||
|  |   - Neutres : {{ summary.total_zero_club }} | ||||||
|  |   - Négatifs : {{ summary.total_negative_club }} soit {{ summary.balance_negative_club / 100 }} € | ||||||
|  |  | ||||||
|  | Clubs hors BDE / Kfet et club dont le nom fini par "- BDE" : | ||||||
|  |   - Positifs : {{ summary.total_positive_club_nbde }} soit {{ summary.balance_positive_club_nbde / 100 }} € | ||||||
|  |   - Neutres : {{ summary.total_zero_club_nbde }} | ||||||
|  |   - Négatifs : {{ summary.total_negative_club_nbde }} soit {{ summary.balance_negative_club_nbde / 100 }} € | ||||||
|  |  | ||||||
|  | Progression : | ||||||
|  |   - Ceci correspond à une différence de {{ balance_difference_user / 100 }} € pour les utilisateur⋅rices | ||||||
|  |   - Ceci correspond à une différence de {{ balance_difference_club / 100 }} € pour les clubs | ||||||
|  |  | ||||||
|  | -- | ||||||
|  | Le BDE | ||||||
|  |  | ||||||
|  | {% trans "Mail generated by the Note Kfet on the" %} {% now "j F Y à H:i:s" %} | ||||||
| @@ -89,7 +89,7 @@ SPDX-License-Identifier: GPL-2.0-or-later | |||||||
|                 </ul> |                 </ul> | ||||||
|                 <div class="card-body"> |                 <div class="card-body"> | ||||||
|                     <select id="debit_type" class="form-control custom-select d-none"> |                     <select id="debit_type" class="form-control custom-select d-none"> | ||||||
|                         {% for special_type in special_types %} |                         {% for special_type in special_types|slice:"::-1" %} | ||||||
|                             <option value="{{ special_type.id }}">{{ special_type.special_type }}</option> |                             <option value="{{ special_type.id }}">{{ special_type.special_type }}</option> | ||||||
|                         {% endfor %} |                         {% endfor %} | ||||||
|                     </select> |                     </select> | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django import template | from django import template | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django import template | from django import template | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from api.tests import TestAPI | from api.tests import TestAPI | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.urls import path | from django.urls import path | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import json | import json | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'permission.apps.PermissionConfig' | default_app_config = 'permission.apps.PermissionConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-lateré | # SPDX-License-Identifier: GPL-3.0-or-lateré | ||||||
|  |  | ||||||
| from django.contrib import admin | from django.contrib import admin | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from rest_framework import serializers | from rest_framework import serializers | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from .views import PermissionViewSet, RoleViewSet | from .views import PermissionViewSet, RoleViewSet | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django_filters.rest_framework import DjangoFilterBackend | from django_filters.rest_framework import DjangoFilterBackend | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import date | from datetime import date, timedelta | ||||||
|  |  | ||||||
| from django.contrib.auth.backends import ModelBackend | from django.contrib.auth.backends import ModelBackend | ||||||
| from django.contrib.auth.models import User | from django.contrib.auth.models import User | ||||||
| @@ -106,6 +106,7 @@ class PermissionBackend(ModelBackend): | |||||||
|                 Q=Q, |                 Q=Q, | ||||||
|                 now=timezone.now(), |                 now=timezone.now(), | ||||||
|                 today=date.today(), |                 today=date.today(), | ||||||
|  |                 week=timedelta(days=7), | ||||||
|             ) |             ) | ||||||
|             yield permission |             yield permission | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
| import sys | import sys | ||||||
| from functools import lru_cache | from functools import lru_cache | ||||||
|   | |||||||
| @@ -127,7 +127,7 @@ | |||||||
|                 "auth", |                 "auth", | ||||||
|                 "user" |                 "user" | ||||||
|             ], |             ], | ||||||
|             "query": "{\"pk\": [\"user\", \"pk\"]}", |             "query": "[\"AND\", {\"pk\": [\"user\", \"pk\"]}, {\"memberships__club__parent_club__isnull\": true}]", | ||||||
|             "type": "change", |             "type": "change", | ||||||
|             "mask": 1, |             "mask": 1, | ||||||
|             "field": "last_login", |             "field": "last_login", | ||||||
| @@ -324,7 +324,7 @@ | |||||||
|             "mask": 2, |             "mask": 2, | ||||||
|             "field": "", |             "field": "", | ||||||
|             "permanent": false, |             "permanent": false, | ||||||
|             "description": "Créer une transaction de ou vers la note d'un club" |             "description": "Créer une transaction de ou vers la note d'un club tant que la source reste au dessus de -20 €" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
| @@ -2591,7 +2591,7 @@ | |||||||
|                 "note", |                 "note", | ||||||
|                 "transaction" |                 "transaction" | ||||||
|             ], |             ], | ||||||
|             "query": "[\"OR\", {\"source__balance__gte\": 0}, [\"AND\", [\"NOT\", {\"recurrenttransaction__template__category__name\": \"Alcool\"}], {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}}], {\"valid\": false}]", |             "query": "[\"OR\", [\"AND\", [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}}, {\"valid\": false}], [\"NOT\", {\"recurrenttransaction__template__category__name\": \"Alcool\"}]], [\"AND\", [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 0]}}, {\"valid\": false}], {\"recurrenttransaction__template__category__name\": \"Alcool\"}]]", | ||||||
|             "type": "add", |             "type": "add", | ||||||
|             "mask": 2, |             "mask": 2, | ||||||
|             "field": "", |             "field": "", | ||||||
| @@ -2607,7 +2607,8 @@ | |||||||
|                 "note", |                 "note", | ||||||
|                 "transaction" |                 "transaction" | ||||||
|             ], |             ], | ||||||
|             "query": "[\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": false}, {\"destination__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": true}]", |             "query": "[\"AND\", [\"OR\", [\"AND\", [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": false}, {\"destination__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": true}], [\"NOT\", {\"recurrenttransaction__template__category__name\": \"Alcool\"}]], [\"AND\", [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 0]}, \"valid\": false}, {\"destination__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": true}], {\"recurrenttransaction__template__category__name\": \"Alcool\"}]], {\"created_at__gte\": {\"F\": [\"SUB\", [\"now\"], [\"week\"]]}}]" | ||||||
|  | , | ||||||
|             "type": "change", |             "type": "change", | ||||||
|             "mask": 2, |             "mask": 2, | ||||||
|             "field": "valid", |             "field": "valid", | ||||||
| @@ -2623,7 +2624,8 @@ | |||||||
|                 "note", |                 "note", | ||||||
|                 "transaction" |                 "transaction" | ||||||
|             ], |             ], | ||||||
|             "query": "[\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": false}, {\"destination__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": true}]", |             "query": "[\"AND\", [\"OR\", [\"AND\", [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": false}, {\"destination__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": true}], [\"NOT\", {\"recurrenttransaction__template__category__name\": \"Alcool\"}]], [\"AND\", [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 0]}, \"valid\": false}, {\"destination__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 2000]}, \"valid\": true}], {\"recurrenttransaction__template__category__name\": \"Alcool\"}]], {\"created_at__gte\": {\"F\": [\"SUB\", [\"now\"], [\"week\"]]}}]" | ||||||
|  | , | ||||||
|             "type": "change", |             "type": "change", | ||||||
|             "mask": 2, |             "mask": 2, | ||||||
|             "field": "invalidity_reason", |             "field": "invalidity_reason", | ||||||
| @@ -3813,7 +3815,7 @@ | |||||||
|             "mask": 2, |             "mask": 2, | ||||||
|             "field": "", |             "field": "", | ||||||
|             "permanent": false, |             "permanent": false, | ||||||
|             "description": "Créer une transaction vers la note d'un club" |             "description": "Créer une transaction vers la note d'un club tant que la source reste au dessus de -20 €" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
| @@ -3832,6 +3834,438 @@ | |||||||
| 	    "description": "Voir les profils des membres du club" | 	    "description": "Voir les profils des membres du club" | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 244, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "profile" | ||||||
|  |             ], | ||||||
|  |             "query": "{}", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 3, | ||||||
|  |             "field": "ml_events_registration", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Modifier l'abonnement à la Newsletter BDE pour n'importe quel profil" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 245, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "profile" | ||||||
|  |             ], | ||||||
|  |             "query": "{}", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 3, | ||||||
|  |             "field": "ml_art_registration", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Modifier l'abonnement à la Newsletter Art pour n'importe quel profil" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 246, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "profile" | ||||||
|  |             ], | ||||||
|  |             "query": "{}", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 3, | ||||||
|  |             "field": "ml_sport_registration", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Modifier l'abonnement à la Newsletter Sport pour n'importe quel profil" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 247, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "activity", | ||||||
|  |                 "guest" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"activity__organizer\": [\"club\"]}", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir les personnes invitées aux événements organisés par son club" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 248, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "auth", | ||||||
|  |                 "user" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"NOT\", {\"pk__isnull\": [\"user\", \"note\", \"activity_responsible\", [\"filter\", {\"activity__open\": true, \"activity__activity_type__manage_entries\":true}], [\"exists\"]]}]", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 3, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir n'importe quel⋅le utilisateur⋅rice pour les ouvreur⋅ses" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 249, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "note" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"NOT\", {\"pk__isnull\": [\"user\", \"note\", \"activity_responsible\", [\"filter\", {\"activity__open\": true, \"activity__activity_type__manage_entries\":true}], [\"exists\"]]}]", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir toutes les notes lorsque utilisateur⋅rice est ouvreur⋅ses" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 250, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "activity", | ||||||
|  |                 "guest" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"activity__organizer\": [\"club\"]}", | ||||||
|  |             "type": "delete", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Supprimer des personnes invitées aux événements organisés par son club" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 251, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "activity", | ||||||
|  |                 "opener" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"activity__organizer\": [\"club\"]}", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir les ouvreur⋅ses des activités organisées par son club" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 252, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "activity", | ||||||
|  |                 "opener" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"activity__organizer\": [\"club\"]}", | ||||||
|  |             "type": "add", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Ajouter des ouvreur⋅ses aux activités organisées par son club" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 253, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "activity", | ||||||
|  |                 "opener" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"activity__organizer\": [\"club\"]}", | ||||||
|  |             "type": "delete", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Supprimer des ouvreur⋅ses aux activités organisées par son club" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 254, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "activity", | ||||||
|  |                 "activity" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"organizer\": [\"club\"]}", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "opener", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir le tableau des ouvreur⋅ses pour les activités organisées par son club" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  | 	"model": "permission.permission", | ||||||
|  | 	"pk": 255, | ||||||
|  | 	"fields": { | ||||||
|  | 	    "model": [ | ||||||
|  | 		"wrapped", | ||||||
|  | 		"wrapped" | ||||||
|  | 	    ], | ||||||
|  | 	    "query": "{\"public\": true}", | ||||||
|  | 	    "type": "view", | ||||||
|  | 	    "mask": 1, | ||||||
|  | 	    "field": "", | ||||||
|  | 	    "permanent": false, | ||||||
|  | 	    "description": "Voir les wrapped public" | ||||||
|  | 	} | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  | 	"model": "permission.permission", | ||||||
|  | 	"pk": 256, | ||||||
|  | 	"fields": { | ||||||
|  | 	    "model": [ | ||||||
|  | 		"wrapped", | ||||||
|  | 		"wrapped" | ||||||
|  | 	    ], | ||||||
|  | 	    "query": "{\"note__noteuser__user\": [\"user\"]}", | ||||||
|  | 	    "type": "view", | ||||||
|  | 	    "mask": 1, | ||||||
|  | 	    "field": "", | ||||||
|  | 	    "permanent": true, | ||||||
|  | 	    "description": "Voir ses propres wrapped, pour toujours" | ||||||
|  | 	} | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  | 	"model": "permission.permission", | ||||||
|  | 	"pk": 257, | ||||||
|  | 	"fields": { | ||||||
|  | 	    "model": [ | ||||||
|  | 		"wrapped", | ||||||
|  | 		"wrapped" | ||||||
|  | 	    ], | ||||||
|  | 	    "query": "{\"note__noteuser__user\": [\"user\"]}", | ||||||
|  | 	    "type": "change", | ||||||
|  | 	    "mask": 1, | ||||||
|  | 	    "field": "public", | ||||||
|  | 	    "permanent": true, | ||||||
|  | 	    "description": "Modifier la visibilité de ses wrapped, pour toujours" | ||||||
|  | 	} | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  | 	"model": "permission.permission", | ||||||
|  | 	"pk": 258, | ||||||
|  | 	"fields": { | ||||||
|  | 	    "model": [ | ||||||
|  | 		"wrapped", | ||||||
|  | 		"wrapped" | ||||||
|  | 	    ], | ||||||
|  | 	    "query": "{\"note__noteclub__club\": [\"club\"]}", | ||||||
|  | 	    "type": "view", | ||||||
|  | 	    "mask": 1, | ||||||
|  | 	    "field": "", | ||||||
|  | 	    "permanent": false, | ||||||
|  | 	    "description": "Voir les wrapped de son club" | ||||||
|  | 	} | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  | 	"model": "permission.permission", | ||||||
|  | 	"pk": 259, | ||||||
|  | 	"fields": { | ||||||
|  | 	    "model": [ | ||||||
|  | 		"wrapped", | ||||||
|  | 		"wrapped" | ||||||
|  | 	    ], | ||||||
|  | 	    "query": "{\"note__noteclub__club\": [\"club\"]}", | ||||||
|  | 	    "type": "change", | ||||||
|  | 	    "mask": 1, | ||||||
|  | 	    "field": "public", | ||||||
|  | 	    "permanent": false, | ||||||
|  | 	    "description": "Modifier la visibilité des wrapped de son club" | ||||||
|  | 	} | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 260, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "club" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"parent_club\": [\"club\"]}", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir les informations d'un club enfant" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 261, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "club" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"parent_club\": [\"club\"]}", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Modifier un club enfant" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 262, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "membership" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"club__parent_club\": [\"club\"]}", | ||||||
|  |             "type": "add", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Ajouter un⋅e membre à un club enfant" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 263, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "member", | ||||||
|  |                 "membership" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"club__parent_club\": [\"club\"]}", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 3, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir les adhérent⋅es du club enfant" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 264, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "transaction" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"OR\", {\"source__noteclub__club__parent_club\": [\"club\"]}, {\"destination__noteclub__club__parent_club\": [\"club\"]}]", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir les transactions d'un club enfant" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 265, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "note" | ||||||
|  |             ], | ||||||
|  |             "query": "{\"noteclub__club__parent_club\": [\"club\"]}", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir la note d'un club enfant" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 266, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "transaction" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"OR\", {\"source_alias\": \"Carte bancaire\"}, {\"source_alias\": \"Espèces\"}, {\"source_alias\": \"Chèque\"}, {\"source_alias\": \"Virement bancaire\"}]", | ||||||
|  |             "type": "view", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Voir les transactions de rechargement" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 267, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "transaction" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"OR\", {\"source_alias\": \"Carte bancaire\"}, {\"source_alias\": \"Espèces\"}, {\"source_alias\": \"Chèque\"}, {\"source_alias\": \"Virement bancaire\"}]", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "valid", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Mettre à jour le statut de validation d'une transaction de rechargement" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 268, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "transaction" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"OR\", {\"source_alias\": \"Carte bancaire\"}, {\"source_alias\": \"Espèces\"}, {\"source_alias\": \"Chèque\"}, {\"source_alias\": \"Virement bancaire\"}]", | ||||||
|  |             "type": "change", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "invalidity_reason", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Modifier la raison d'invalidité d'une transaction de rechargement" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 269, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "transaction" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"OR\", {\"source_alias\": \"Carte bancaire\"}, {\"source_alias\": \"Espèces\"}, {\"source_alias\": \"Chèque\"}, {\"source_alias\": \"Virement bancaire\"}]", | ||||||
|  |             "type": "add", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Créer une transaction de rechargement" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |         "model": "permission.permission", | ||||||
|  |         "pk": 270, | ||||||
|  |         "fields": { | ||||||
|  |             "model": [ | ||||||
|  |                 "note", | ||||||
|  |                 "transaction" | ||||||
|  |             ], | ||||||
|  |             "query": "[\"AND\", [\"OR\", {\"source\": [\"club\", \"note\"]}, {\"destination\": [\"club\", \"note\"]}], [\"OR\", {\"source__balance__gte\": {\"F\": [\"SUB\", [\"MUL\", [\"F\", \"amount\"], [\"F\", \"quantity\"]], 5000]}}, {\"valid\": false}]]", | ||||||
|  |             "type": "add", | ||||||
|  |             "mask": 2, | ||||||
|  |             "field": "", | ||||||
|  |             "permanent": false, | ||||||
|  |             "description": "Créer une transaction de ou vers la note d'un club tant que la source reste au dessus de -50 €" | ||||||
|  |         } | ||||||
|  |     }, | ||||||
|     { |     { | ||||||
|         "model": "permission.role", |         "model": "permission.role", | ||||||
|         "pk": 1, |         "pk": 1, | ||||||
| @@ -3881,7 +4315,12 @@ | |||||||
|                 203, |                 203, | ||||||
|                 204, |                 204, | ||||||
|                 205, |                 205, | ||||||
|                 206 |                 206, | ||||||
|  |                 248, | ||||||
|  |                 249, | ||||||
|  | 		255, | ||||||
|  | 		256, | ||||||
|  | 		257 | ||||||
|             ] |             ] | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
| @@ -3970,7 +4409,10 @@ | |||||||
|                 227, |                 227, | ||||||
|                 233, |                 233, | ||||||
|                 234, |                 234, | ||||||
|                 237 |                 237, | ||||||
|  | 		247, | ||||||
|  | 		258, | ||||||
|  | 		259 | ||||||
|             ] |             ] | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
| @@ -4382,10 +4824,11 @@ | |||||||
|             "for_club": 1, |             "for_club": 1, | ||||||
|             "name": "GC anti-VSS", |             "name": "GC anti-VSS", | ||||||
|             "permissions": [ |             "permissions": [ | ||||||
|  |                 42, | ||||||
|  | 		135, | ||||||
| 		150, | 		150, | ||||||
|                 163, |                 163, | ||||||
|                 164, |                 164 | ||||||
|                 182 |  | ||||||
|             ] |             ] | ||||||
|         } |         } | ||||||
|     }, |     }, | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import functools | import functools | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from rest_framework.permissions import DjangoObjectPermissions | from rest_framework.permissions import DjangoObjectPermissions | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
| from oauth2_provider.oauth2_validators import OAuth2Validator | from oauth2_provider.oauth2_validators import OAuth2Validator | ||||||
| from oauth2_provider.scopes import BaseScopes | from oauth2_provider.scopes import BaseScopes | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.core.exceptions import PermissionDenied | from django.core.exceptions import PermissionDenied | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| import django_tables2 as tables | import django_tables2 as tables | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib.contenttypes.models import ContentType | from django.contrib.contenttypes.models import ContentType | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import timedelta | from datetime import timedelta | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import timedelta, date | from datetime import timedelta, date | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from datetime import date | from datetime import date, timedelta | ||||||
| from json.decoder import JSONDecodeError | from json.decoder import JSONDecodeError | ||||||
|  |  | ||||||
| from django.contrib.auth.models import User | from django.contrib.auth.models import User | ||||||
| @@ -73,6 +73,7 @@ class PermissionQueryTestCase(TestCase): | |||||||
|                     Q=Q, |                     Q=Q, | ||||||
|                     now=timezone.now(), |                     now=timezone.now(), | ||||||
|                     today=date.today(), |                     today=date.today(), | ||||||
|  |                     week=timedelta(days=7), | ||||||
|                 ) |                 ) | ||||||
|                 instanced.update_query() |                 instanced.update_query() | ||||||
|                 query = instanced.query |                 query = instanced.query | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.contrib.auth.models import User | from django.contrib.auth.models import User | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.conf import settings | from django.conf import settings | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
| from collections import OrderedDict | from collections import OrderedDict | ||||||
| from datetime import date | from datetime import date | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| default_app_config = 'registration.apps.RegistrationConfig' | default_app_config = 'registration.apps.RegistrationConfig' | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django.apps import AppConfig | from django.apps import AppConfig | ||||||
|   | |||||||
| @@ -1,4 +1,4 @@ | |||||||
| # Copyright (C) 2018-2024 by BDE ENS Paris-Saclay | # Copyright (C) 2018-2025 by BDE ENS Paris-Saclay | ||||||
| # SPDX-License-Identifier: GPL-3.0-or-later | # SPDX-License-Identifier: GPL-3.0-or-later | ||||||
|  |  | ||||||
| from django import forms | from django import forms | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user