spaetz' rule: Don't do sth 4 times when once suffices.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
# Split the tag string into a list of tags
for tag in stripped_tag_string.split(','):
-
+ tag = tag.strip()
# Ignore empty or duplicate tags
- if tag.strip() and tag.strip() not in [t['name'] for t in taglist]:
-
- taglist.append({'name': tag.strip(),
- 'slug': url.slugify(tag.strip())})
+ if tag and tag not in [t['name'] for t in taglist]:
+ taglist.append({'name': tag,
+ 'slug': url.slugify(tag)})
return taglist