diff options
author | Alban Gruin | 2017-10-01 11:26:18 +0200 |
---|---|---|
committer | Alban Gruin | 2017-10-01 11:26:18 +0200 |
commit | d015314d3ccbb35f52a28698444de8ff60002e10 (patch) | |
tree | 88aececacbe186df52beef82b1149bd727fdad99 | |
parent | e3594050b78d3b28b5696e9a546163945d8073da (diff) |
On affiche pas plus d’un mois en avance
-rw-r--r-- | views.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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") |