aboutsummaryrefslogtreecommitdiff
path: root/views.py
diff options
context:
space:
mode:
authorAlban Gruin2017-10-01 11:26:18 +0200
committerAlban Gruin2017-10-01 11:26:18 +0200
commitd015314d3ccbb35f52a28698444de8ff60002e10 (patch)
tree88aececacbe186df52beef82b1149bd727fdad99 /views.py
parente3594050b78d3b28b5696e9a546163945d8073da (diff)
On affiche pas plus d’un mois en avance
Diffstat (limited to 'views.py')
-rw-r--r--views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/views.py b/views.py
index 14a4208..d34fadd 100644
--- a/views.py
+++ b/views.py
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with celcatsanitizer. If not, see <http://www.gnu.org/licenses/>.
+import datetime
+
from django.conf import settings
from django.db.models import Max
from django.http import Http404
@@ -34,7 +36,8 @@ def mention_list(request, year_slug):
def group_list_common(request, timetable, groups):
year, week = get_current_week()
start, _ = get_week(year, week)
- groups_weeks = Course.objects.get_weeks(begin__gte=start, timetable=timetable) \
+ end = start + datetime.timedelta(weeks=4)
+ groups_weeks = Course.objects.get_weeks(begin__gte=start, begin__lt=end, timetable=timetable) \
.values("groups__mention", "groups__subgroup",
"groups__td", "groups__tp", "year", "week")