From a32881a24ba09c5e008d6e669c486ece5228080d Mon Sep 17 00:00:00 2001 From: Qwann Date: Thu, 4 Oct 2018 21:34:39 +0200 Subject: [PATCH 1/4] MAJ allauth --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index ac9d21b..60d62ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,8 +7,7 @@ django-allauth==0.36.0 django-allauth-cas==1.0.0b2 django-tables2==2.0.0a2 django-filter==2.0.0 -#git+https://git.eleves.ens.fr/cof-geek/django-allauth-ens@6e77b31e0dfed7659776d -git+https://git.eleves.ens.fr/cof-geek/django-allauth-ens@30a072b7db1fc2d4652284227a3e7e876b14c915 +django-allauth-ens django-bootstrap-form==3.4 drf-nested-routers==0.90.0 django-notifications==0.1.dev0 From 94a629371c94c0844de8df48dd0a7db4be808e2f Mon Sep 17 00:00:00 2001 From: Qwann Date: Thu, 11 Oct 2018 09:48:03 +0200 Subject: [PATCH 2/4] =?UTF-8?q?allauth=20don't=20works=20right=20now?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- poulpe/settings/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poulpe/settings/common.py b/poulpe/settings/common.py index 4c1fa0a..5d458b6 100644 --- a/poulpe/settings/common.py +++ b/poulpe/settings/common.py @@ -214,4 +214,4 @@ SOCIALACCOUNT_PROVIDERS = { ACCOUNT_ADAPTER = 'shared.allauth_adapter.AccountAdapter' -SOCIALACCOUNT_ADAPTER = 'shared.allauth_adapter.SocialAccountAdapter' +SOCIALACCOUNT_ADAPTER='allauth_ens.adapter.LongTermClipperAccountAdapter' From b1c0dd857d1bb6bb96541cd4c36d7e14835bbac6 Mon Sep 17 00:00:00 2001 From: Qwann Date: Wed, 7 Nov 2018 21:39:50 +0100 Subject: [PATCH 3/4] search matos --- event/admin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/event/admin.py b/event/admin.py index b68f328..5bcd63b 100644 --- a/event/admin.py +++ b/event/admin.py @@ -5,6 +5,7 @@ from equipment.models import EquipmentAttribution class EquipmentAttributionExtraInline(admin.TabularInline): + autocomplete_fields = ['equipment', ] model = EquipmentAttribution extra = 0 classes = ['collapse'] From 511c3096f7e060fca3a8901ed42be66a23b0b7b4 Mon Sep 17 00:00:00 2001 From: Evarin Date: Mon, 12 Nov 2018 21:44:10 +0100 Subject: [PATCH 4/4] enrol?ajax=json renvoie un JSON pour le calendrier dynamique --- event/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/event/views.py b/event/views.py index 5a5d3df..6e29dde 100644 --- a/event/views.py +++ b/event/views.py @@ -52,6 +52,12 @@ class EnrolActivityView(LoginRequiredMixin, View): else: success = False if "ajax" in request.GET: + if request.GET["ajax"] == "json": + enrols = activity.staff + return JsonResponse({ + "enrolled": enrols.filter(id=request.user.id).exists(), + "number": enrols.count(), + }) return render(request, "event/activity_summary.html", {"activity": activity}) return HttpResponseRedirect(reverse("event:activity", kwargs={"pk":pk}))