diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2016-04-19 18:25:37 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2016-04-19 18:25:37 (GMT) |
commit | 3c78c9f3f4af3c52725947f277e37938fd6d4f08 (patch) | |
tree | 304010bbb643602965cfeba5684ab9b41de04b1b /program/management/commands/importnotes.py | |
parent | 1d3301368c60efcb62dd4161e9e464c924b8f4d3 (diff) |
fixed pep8/flake8 warnings. again.
Diffstat (limited to 'program/management/commands/importnotes.py')
-rw-r--r-- | program/management/commands/importnotes.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/program/management/commands/importnotes.py b/program/management/commands/importnotes.py index 287dcef..0a1ab0f 100644 --- a/program/management/commands/importnotes.py +++ b/program/management/commands/importnotes.py @@ -1,7 +1,6 @@ -from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, ValidationError from django.core.management.base import NoArgsCommand -from django.utils.html import clean_html, strip_tags +from django.utils.html import strip_tags import MySQLdb @@ -11,6 +10,7 @@ USER = 'helsinki' PASSWD = 'helsinki' DB = 'helsinki' + class Command(NoArgsCommand): help = 'Import notes from current program' @@ -26,7 +26,7 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d for ntitel, datum, stitel, notiz in cursor.fetchall(): ntitel = strip_tags(ntitel) if ntitel else strip_tags(stitel) stitel = strip_tags(stitel) - notiz = clean_html(notiz) + notiz = strip_tags(notiz) if stitel.endswith('(Wiederholung)'): stitel = stitel[:-15] @@ -39,7 +39,8 @@ WHERE n.sendung_id in (SELECT id FROM sendungen WHERE letzter_termin > current_d print 'show with name "%s" not found' % stitel else: try: - timeslot = TimeSlot.objects.get(programslot__show=show, start__year=year, start__month=month, start__day=day) + timeslot = TimeSlot.objects.get(programslot__show=show, start__year=year, start__month=month, + start__day=day) except ObjectDoesNotExist: print 'no timeslot found for sendung "%s" and datum "%s"' % (stitel, datum) except MultipleObjectsReturned: |