diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-09 22:51:14 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-08-09 22:51:14 -0400 |
commit | 62de287fce900930101dc9c878d497d932ade740 (patch) | |
tree | ec05dfa99bd52ade20723305f7e52b4a2b8398e0 | |
parent | c8a0a1fb94f3ec070f7980c8301a8a851f715038 (diff) | |
download | askbot-62de287fce900930101dc9c878d497d932ade740.tar.gz askbot-62de287fce900930101dc9c878d497d932ade740.tar.bz2 askbot-62de287fce900930101dc9c878d497d932ade740.zip |
fixed bug in tag cleaning form
-rw-r--r-- | askbot/forms.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/askbot/forms.py b/askbot/forms.py index c9ce155c..aec40d97 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -384,11 +384,11 @@ def clean_tag(tag_name): #a simpler way to handle tags - just lowercase thew all return tag_name.lower() else: - try: - from askbot import models - stored_tag = models.Tag.objects.get(name__iexact=tag_name) - return stored_tag.name - except models.Tag.DoesNotExist: + from askbot import models + matching_tags = models.Tag.objects.filter(name__iexact=tag_name) + if len(matching_tags) > 0: + return matching_tags[0].name + else: return tag_name |