Merge pull request #63 from codersquid/flake8scheduleform
flake8 fixes for the schedule edit form.
This commit is contained in:
commit
a4c4e6953c
1 changed files with 11 additions and 3 deletions
|
@ -1,9 +1,15 @@
|
||||||
|
import csv
|
||||||
|
import time
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from django import forms
|
from django import forms
|
||||||
|
from django.contrib import messages
|
||||||
|
from django.db import IntegrityError
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from markitup.widgets import MarkItUpWidget
|
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):
|
class SlotEditForm(forms.Form):
|
||||||
|
@ -139,8 +145,10 @@ class ScheduleSectionForm(forms.Form):
|
||||||
)
|
)
|
||||||
created_items.append(slot)
|
created_items.append(slot)
|
||||||
try:
|
try:
|
||||||
with transaction.atomic():
|
# @@@ TODO - upgrade Django, use atomic transactions
|
||||||
SlotRoom.objects.create(slot=slot, room=room)
|
# with transaction.atomic():
|
||||||
|
# SlotRoom.objects.create(slot=slot, room=room)
|
||||||
|
SlotRoom.objects.create(slot=slot, room=room)
|
||||||
except IntegrityError:
|
except IntegrityError:
|
||||||
# delete all created objects and report error
|
# delete all created objects and report error
|
||||||
for x in created_items:
|
for x in created_items:
|
||||||
|
|
Loading…
Reference in a new issue