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'] diff --git a/event/views.py b/event/views.py index a1a57a1..62da531 100644 --- a/event/views.py +++ b/event/views.py @@ -65,6 +65,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})) 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' 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