diff options
author | Alban Gruin | 2017-01-22 19:11:50 +0100 |
---|---|---|
committer | Alban Gruin | 2017-01-22 19:11:50 +0100 |
commit | 5eef84c1b175841caebdb066e0e1e6e1038e8c65 (patch) | |
tree | d4c5872d1977d4c8ca2e2d5ab7fac45236d0bb77 | |
parent | e0d2b72c30ec26ca953c52d6bec33dc030d18947 (diff) |
Remplacement de render_to_request() par render()
-rw-r--r-- | views.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,6 +1,6 @@ from django.http import HttpResponse, Http404 from django.db.models import Count -from django.shortcuts import get_object_or_404, redirect, render, render_to_response +from django.shortcuts import get_object_or_404, redirect, render from django.utils import timezone from edt.models import Timetable, LastUpdate, Group, Subscription, Course @@ -22,7 +22,7 @@ def index(request): weeks.append(date) group.weeks = weeks - return render_to_response("index.html", {"timetables": timetables, "groups": groups}) + return render(request, "index.html", {"timetables": timetables, "groups": groups}) def timetable(request, timetable_slug, year, week, group_slug): start, end = get_week(int(year), int(week)) @@ -40,7 +40,7 @@ def timetable(request, timetable_slug, year, week, group_slug): else: grouped_courses[-1].append(course) - return render_to_response("timetable.html", {"timetable": timetable, "group": group, "courses": grouped_courses, "last_update": last_update.date, "year": year, "week": week}) + return render(request, "timetable.html", {"timetable": timetable, "group": group, "courses": grouped_courses, "last_update": last_update.date, "year": year, "week": week}) def subscribe(request, timetable_slug, year, week, group_slug): group = get_object_or_404(Group, slug=group_slug) |