aboutsummaryrefslogtreecommitdiff
path: root/management
diff options
context:
space:
mode:
authorAlban Gruin2017-01-20 10:22:03 +0100
committerAlban Gruin2017-01-20 10:22:03 +0100
commitd8b1738aacc08c3ff28a7bdd0c29e276458a902f (patch)
treec4b8f28ce46aad3a9f9a27d2f94d0d0c718b5aba /management
parent14c5a5675338eaddda4dbc38c5bbebfd4093b1ca (diff)
Le traitement des données est faite avec une transaction
Diffstat (limited to 'management')
-rw-r--r--management/commands/timetables.py2
1 files changed, 2 insertions, 0 deletions
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)