summaryrefslogtreecommitdiff
path: root/program/management/commands/addnote.py
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2016-04-19 18:25:37 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2016-04-19 18:25:37 (GMT)
commit3c78c9f3f4af3c52725947f277e37938fd6d4f08 (patch)
tree304010bbb643602965cfeba5684ab9b41de04b1b /program/management/commands/addnote.py
parent1d3301368c60efcb62dd4161e9e464c924b8f4d3 (diff)
fixed pep8/flake8 warnings. again.
Diffstat (limited to 'program/management/commands/addnote.py')
-rw-r--r--program/management/commands/addnote.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/program/management/commands/addnote.py b/program/management/commands/addnote.py
index 01d891e..5c0147e 100644
--- a/program/management/commands/addnote.py
+++ b/program/management/commands/addnote.py
@@ -1,4 +1,3 @@
-from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from django.core.exceptions import ValidationError
@@ -7,6 +6,7 @@ import sys
from program.models import Show, TimeSlot, Note
+
class Command(BaseCommand):
help = 'adds a note to a timeslot'
args = '<show_id> <start_date> <status> [index]'
@@ -40,11 +40,13 @@ class Command(BaseCommand):
timeslot = TimeSlot.objects.get(show=show, start__year=year, start__month=month, start__day=day)
except TimeSlot.DoesNotExist as dne:
raise CommandError(dne)
- except TimeSlot.MultipleObjectsReturned as mor:
+ except TimeSlot.MultipleObjectsReturned:
if not index:
- raise CommandError('you must provide the show_id, start_date, status index')
+ raise CommandError('you must provide the show_id, start_date, status index')
try:
- timeslot = TimeSlot.objects.filter(show=show, start__year=year, start__month=month, start__day=day).order_by('start')[int(index)]
+ timeslot = \
+ TimeSlot.objects.filter(show=show, start__year=year, start__month=month, start__day=day).order_by(
+ 'start')[int(index)]
except IndexError as ie:
raise CommandError(ie)
@@ -63,4 +65,3 @@ class Command(BaseCommand):
else:
note.save()
print 'added note "%s" to "%s"' % (title, timeslot)
-