flake8 fixes for the schedule edit form. imports were missing. added a TODO for the atomic call, which is not supported in django 1.4

This commit is contained in:
Sheila Miguez 2014-09-27 12:10:24 -05:00
parent c17a4cbda1
commit ee1f4d92a5

View file

@ -1,9 +1,15 @@
import csv
import time
from datetime import datetime
from django import forms
from django.contrib import messages
from django.db import IntegrityError
from django.db.models import Q
from markitup.widgets import MarkItUpWidget
from symposion.schedule.models import Presentation
from symposion.schedule.models import (Day, Presentation, Room, SlotKind, Slot, SlotRoom)
class SlotEditForm(forms.Form):
@ -139,7 +145,9 @@ class ScheduleSectionForm(forms.Form):
)
created_items.append(slot)
try:
with transaction.atomic():
# @@@ TODO - upgrade Django, use atomic transactions
# with transaction.atomic():
# SlotRoom.objects.create(slot=slot, room=room)
SlotRoom.objects.create(slot=slot, room=room)
except IntegrityError:
# delete all created objects and report error