diff options
Diffstat (limited to 'management/commands')
-rw-r--r-- | management/commands/timetables.py | 2 |
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) |