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/importshows.py | |
parent | 1d3301368c60efcb62dd4161e9e464c924b8f4d3 (diff) |
fixed pep8/flake8 warnings. again.
Diffstat (limited to 'program/management/commands/importshows.py')
-rw-r--r-- | program/management/commands/importshows.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/program/management/commands/importshows.py b/program/management/commands/importshows.py index d5fdee7..f1353b8 100644 --- a/program/management/commands/importshows.py +++ b/program/management/commands/importshows.py @@ -1,7 +1,7 @@ from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.management.base import NoArgsCommand from django.template.defaultfilters import slugify -from django.utils.html import clean_html, strip_tags +from django.utils.html import strip_tags import MySQLdb @@ -13,9 +13,10 @@ DB = 'helsinki' TALK = BroadcastFormat.objects.get(pk=1) + class Command(NoArgsCommand): help = 'Import shows from the current program' - + def handle_noargs(self, **options): connection = MySQLdb.connect(user=USER, passwd=PASSWD, db=DB) cursor = connection.cursor() @@ -29,7 +30,7 @@ ORDER BY titel, beginn, ende""") for titel, beschreibung, web, macher in cursor.fetchall(): titel = strip_tags(titel) - beschreibung = clean_html(beschreibung) + beschreibung = strip_tags(beschreibung) slug = slugify(titel) @@ -50,7 +51,8 @@ ORDER BY titel, beginn, ende""") show = Show.objects.get(name=titel) print 'sendung "%s" already imported as show "%s"' % (titel, show) except ObjectDoesNotExist: - show = Show(broadcastformat=TALK, name=titel, slug=slug, short_description='FIXME', description=beschreibung) + show = Show(broadcastformat=TALK, name=titel, slug=slug, short_description='FIXME', + description=beschreibung) try: show.save() counter += 1 |