From 038f30ca23947a5b043f8db4670034de9d90ad24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Mon, 5 Sep 2016 15:41:48 +0200 Subject: [PATCH] Strip whitespace when looking up category --- mygpo/directory/tags.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mygpo/directory/tags.py b/mygpo/directory/tags.py index 788d9b02..c6e0073c 100644 --- a/mygpo/directory/tags.py +++ b/mygpo/directory/tags.py @@ -53,13 +53,13 @@ def update_category(podcast): if not all_tags: return - random_tag = choice(all_tags) + random_tag = choice(all_tags).strip() try: category, created = Category.objects.get_or_create( - tags__tag=slugify(random_tag.strip()), + tags__tag=slugify(random_tag), defaults={ - 'title': random_tag.strip(), + 'title': random_tag, } ) -- 2.11.4.GIT