From 211e7b448d039762fe7a1477bb43feb699237df5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 13 Jun 2016 19:08:14 +0200 Subject: [PATCH 1/9] =?UTF-8?q?R=C3=A9pare=20les=20sondages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cause de l'erreur : Lors du déplacement des formulaires vers de fichiers différents, une méthode du formulaire des sondages a été oubliée. Erreur localisée dans 65667f6652561408d1113d756d18fc277de7c332 --- gestioncof/forms.py | 10 ++++++++++ gestioncof/views.py | 5 ----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gestioncof/forms.py b/gestioncof/forms.py index 751755b4..f74a10d6 100644 --- a/gestioncof/forms.py +++ b/gestioncof/forms.py @@ -79,6 +79,16 @@ class SurveyForm(forms.Form): field.question_id = question.id self.fields["question_%d" % question.id] = field + def answers(self): + for name, value in self.cleaned_data.items(): + if name.startswith('question_'): + yield (self.fields[name].question_id, value) + + # Ajoute pour sondage pulms + def as_p_formate(self): + return 'Hello world !' + #return re.sub("[img (.+?)]", "", self.as_p()) + class SurveyStatusFilterForm(forms.Form): def __init__(self, *args, **kwargs): survey = kwargs.pop("survey") diff --git a/gestioncof/views.py b/gestioncof/views.py index 963fd5f5..70084e14 100644 --- a/gestioncof/views.py +++ b/gestioncof/views.py @@ -59,11 +59,6 @@ def logout(request): else: return redirect("django.contrib.auth.views.logout") - def answers(self): - for name, value in self.cleaned_data.items(): - if name.startswith('question_'): - yield (self.fields[name].question_id, value) - @login_required def survey(request, survey_id): survey = get_object_or_404(Survey, id = survey_id) From daa8e4709053fe400a0462584def22ab3879f2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Thu, 16 Jun 2016 00:39:55 +0200 Subject: [PATCH 2/9] Supprime les bonnes attributions lors d'un tirage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ne supprime plus toutes les attributions en lançant un tirage mais seulement les attributions du tirage que l'on lance. Fixes #44 --- bda/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bda/views.py b/bda/views.py index 41c3c94d..3f206e63 100644 --- a/bda/views.py +++ b/bda/views.py @@ -237,7 +237,9 @@ def do_tirage(request, tirage_id): # FIXME: Établir les conditions de validations (formulaire ?) # cf. issue #32 if False: - Attribution.objects.all().delete() + Attribution.objects.filter( + spectacle__tirage=tirage_elt + ).all().delete() for (show, members, _) in results: for (member, _, _, _) in members: attrib = Attribution(spectacle=show, participant=member) From 976a130dcb179b2acc912fd5940333f93234507d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Thu, 16 Jun 2016 09:31:08 +0200 Subject: [PATCH 3/9] Suppression d'un `.all()` inutile. --- bda/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bda/views.py b/bda/views.py index 3f206e63..2fdd7542 100644 --- a/bda/views.py +++ b/bda/views.py @@ -239,7 +239,7 @@ def do_tirage(request, tirage_id): if False: Attribution.objects.filter( spectacle__tirage=tirage_elt - ).all().delete() + ).delete() for (show, members, _) in results: for (member, _, _, _) in members: attrib = Attribution(spectacle=show, participant=member) From 8edd6dafcdb57fc94491505a45ad77fbd7eb6e52 Mon Sep 17 00:00:00 2001 From: ludo Date: Fri, 17 Jun 2016 18:31:10 +0200 Subject: [PATCH 4/9] =?UTF-8?q?Ajoute=20une=20fonction=20de=20remise=20?= =?UTF-8?q?=C3=A0=20z=C3=A9ro=20des=20compteurs=20de=20petits=20cours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/admin.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gestioncof/admin.py b/gestioncof/admin.py index 785ab6a2..03cb3b33 100644 --- a/gestioncof/admin.py +++ b/gestioncof/admin.py @@ -154,6 +154,13 @@ class PetitCoursAttributionCounterAdmin(admin.ModelAdmin): list_display = ('user','matiere','count',) list_filter = ('matiere',) search_fields = ('user__username', 'user__first_name', 'user__last_name', 'user__email', 'matiere__name') + actions = ['reset',] + actions_on_bottom = True + + def reset(self, request, queryset): + queryset.update(count=0) + reset.short_description = u"Remise à zéro du compteur" + class PetitCoursDemandeAdmin(admin.ModelAdmin): list_display = ('name','email','agrege_requis','niveau','created','traitee','processed') From 014a2c2361cf026b3e2afbeebddcbe4688d99948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 19 Jun 2016 11:08:32 +0200 Subject: [PATCH 5/9] Supprime une fonction inutile. Probablement un vestige de debug. --- gestioncof/forms.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/gestioncof/forms.py b/gestioncof/forms.py index f74a10d6..a470face 100644 --- a/gestioncof/forms.py +++ b/gestioncof/forms.py @@ -84,11 +84,6 @@ class SurveyForm(forms.Form): if name.startswith('question_'): yield (self.fields[name].question_id, value) - # Ajoute pour sondage pulms - def as_p_formate(self): - return 'Hello world !' - #return re.sub("[img (.+?)]", "", self.as_p()) - class SurveyStatusFilterForm(forms.Form): def __init__(self, *args, **kwargs): survey = kwargs.pop("survey") From fd7673b0569564ff6b8fa28e09794b75c54989bf Mon Sep 17 00:00:00 2001 From: Martin Pepin Date: Sun, 19 Jun 2016 12:22:17 +0200 Subject: [PATCH 6/9] Update README.md Ajout d'un commentaire sur l'existence d'une doc utilisateur. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index ddfa177c..0d5d0e54 100644 --- a/README.md +++ b/README.md @@ -162,3 +162,10 @@ Pour mettre à jour les paquets Python, utiliser la commande suivante : Pour mettre à jour les modèles après une migration, il faut ensuite faire : python manage.py migrate + + +## Documentation utilisateur + +Une brève documentation utilisateur pour se faliliariser plus vite avec l'outil +est accessible sur le +[wiki](https://git.eleves.ens.fr/cof-geek/gestioCOF/wikis/home). From 25fc2579f0b0be81ce36cc4029e71d6c35c376f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sun, 19 Jun 2016 18:34:44 +0200 Subject: [PATCH 7/9] Incorpore le tirage dans `admin/participant`. - Affiche le tirage de chaque participant. - Permet de filtrer par tirage --- bda/admin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bda/admin.py b/bda/admin.py index 2cdce0a6..476f7d89 100644 --- a/bda/admin.py +++ b/bda/admin.py @@ -16,7 +16,6 @@ class AttributionInline(admin.TabularInline): model = Attribution class ParticipantAdmin(admin.ModelAdmin): - #inlines = [ChoixSpectacleInline] inlines = [AttributionInline] def get_queryset(self, request): return Participant.objects.annotate(nb_places = Count('attributions'), @@ -31,8 +30,9 @@ class ParticipantAdmin(admin.ModelAdmin): else: return u"0 €" total.admin_order_field = "total" total.short_description = "Total à payer" - list_display = ("user", "nb_places", "total", "paid", "paymenttype") - list_filter = ("paid",) + list_display = ("user", "nb_places", "total", "paid", "paymenttype", + "tirage") + list_filter = ("paid", "tirage") search_fields = ('user__username', 'user__first_name', 'user__last_name') actions = ['send_attribs',] actions_on_bottom = True From deddb1a80dc38f11c906d1b00cbc4ad8cd4f7547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Mon, 20 Jun 2016 20:26:22 +0200 Subject: [PATCH 8/9] =?UTF-8?q?R=C3=A9pare=20un=20lien=20vers=20une=20imag?= =?UTF-8?q?e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestioncof/templates/petits_cours_demandes_list.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gestioncof/templates/petits_cours_demandes_list.html b/gestioncof/templates/petits_cours_demandes_list.html index b3115815..101da253 100644 --- a/gestioncof/templates/petits_cours_demandes_list.html +++ b/gestioncof/templates/petits_cours_demandes_list.html @@ -20,7 +20,7 @@ {% for matiere in demande.matieres.all %}{% if forloop.counter0 > 0 %}, {% endif %}{{ matiere }}{% endfor %} {{ demande.created|date:"d E Y" }} - {% if demande.traitee_par %}{{ demande.traitee_par.username }}{% else %}{% endif %} + {% if demande.traitee_par %}{{ demande.traitee_par.username }}{% else %}{% endif %} Détails {% endfor %} From 93e7fbf87dd247efd312a298ca59e0b3b3f92835 Mon Sep 17 00:00:00 2001 From: ludo Date: Thu, 23 Jun 2016 18:07:01 +0200 Subject: [PATCH 9/9] redirige admin/logout vers /logout --- cof/urls.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cof/urls.py b/cof/urls.py index ce7cd6f6..f0b3c207 100644 --- a/cof/urls.py +++ b/cof/urls.py @@ -53,6 +53,7 @@ urlpatterns = patterns('', url(r'^autocomplete/registration$', 'gestioncof.autocomplete.autocomplete'), url(r'^autocomplete/', include('autocomplete_light.urls')), # Interface admin + url(r'^admin/logout/', 'gestioncof.views.logout'), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/(?P[\d\w]+)/(?P[\d\w]+)/csv/', 'gestioncof.csv_views.admin_list_export',