From 4247730ce462f746a1c4405a5382226343b776b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 11 Sep 2020 20:23:23 +0200 Subject: [PATCH 1/3] Event.calendrier is not a bool anymore --- calendrier/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendrier/views.py b/calendrier/views.py index 12cf2d8..e241bdf 100644 --- a/calendrier/views.py +++ b/calendrier/views.py @@ -57,7 +57,7 @@ def calendar(request, pYear, pMonth): lCalendarToMonth = datetime(lYear, lMonth, monthrange(lYear, lMonth)[1]) lEvents = Event.objects.filter(date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth, - calendrier=True) + calendrier="F") if request.user.is_authenticated: lEvents = Event.objects.filter(date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth) -- 2.47.0 From 8d3805a922c17a0e1d00a7b87aa8ed37b621b9eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 11 Sep 2020 20:33:43 +0200 Subject: [PATCH 2/3] Fix ill-typed query ordering --- partitions/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partitions/models.py b/partitions/models.py index 95de22e..0c94773 100644 --- a/partitions/models.py +++ b/partitions/models.py @@ -34,7 +34,7 @@ class Partition(models.Model): class Meta: verbose_name = _('Morceau') verbose_name_plural = _('Morceaux') - ordering = ('-'+Lower('nom'),) + ordering = (Lower('nom'),) class PartitionSet(models.Model): @@ -54,4 +54,4 @@ class PartitionSet(models.Model): class Meta: verbose_name = _('Morceau') verbose_name_plural = _('Morceaux') - ordering = ('-'+Lower('nom'),) + ordering = (Lower('nom'),) -- 2.47.0 From c3f9b26aeadc6ad8d1919ba7835a63f506703516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Sat, 12 Sep 2020 19:05:16 +0200 Subject: [PATCH 3/3] Show all events to logged-in users --- calendrier/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/calendrier/views.py b/calendrier/views.py index e241bdf..647d7f0 100644 --- a/calendrier/views.py +++ b/calendrier/views.py @@ -55,9 +55,9 @@ def calendar(request, pYear, pMonth): lMonth = int(pMonth) lCalendarFromMonth = datetime(lYear, lMonth, 1) lCalendarToMonth = datetime(lYear, lMonth, monthrange(lYear, lMonth)[1]) - lEvents = Event.objects.filter(date__gte=lCalendarFromMonth, - date__lte=lCalendarToMonth, - calendrier="F") + lEvents = Event.objects.filter( + date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth + ) if request.user.is_authenticated: lEvents = Event.objects.filter(date__gte=lCalendarFromMonth, date__lte=lCalendarToMonth) -- 2.47.0