From ee1f4d92a53175280f4ca83de837b4dc9e3b1081 Mon Sep 17 00:00:00 2001 From: Sheila Miguez Date: Sat, 27 Sep 2014 12:10:24 -0500 Subject: [PATCH] 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 --- symposion/schedule/forms.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/symposion/schedule/forms.py b/symposion/schedule/forms.py index 161f0396..f9b863ac 100644 --- a/symposion/schedule/forms.py +++ b/symposion/schedule/forms.py @@ -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,8 +145,10 @@ class ScheduleSectionForm(forms.Form): ) created_items.append(slot) try: - with transaction.atomic(): - SlotRoom.objects.create(slot=slot, room=room) + # @@@ 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 for x in created_items: