From d8b1738aacc08c3ff28a7bdd0c29e276458a902f Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Fri, 20 Jan 2017 10:22:03 +0100 Subject: Le traitement des données est faite avec une transaction --- management/commands/timetables.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'management/commands') diff --git a/management/commands/timetables.py b/management/commands/timetables.py index c67cb0b..37a5201 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -1,4 +1,5 @@ from django.core.management.base import BaseCommand, CommandError +from django.db import transaction from django.utils import timezone from edt.models import Timetable, Group, Room, Course @@ -28,6 +29,7 @@ class Command(BaseCommand): for week in weeks: yield year, week + @transaction.atomic def handle(self, *args, **options): for year, week in self.__get_weeks(options["week"]): delete_courses_in_week(year, week) -- cgit v1.2.1