diff options
author | Eugene Kim <p.compassion@gmail.com> | 2013-05-27 15:19:29 +0900 |
---|---|---|
committer | Eugene Kim <p.compassion@gmail.com> | 2013-05-27 15:19:29 +0900 |
commit | 29a2fe43934c163e0ae806ff086cdce45dd9882c (patch) | |
tree | 163d13ea4ff4f3fccc8571967d6fb463efda99f0 | |
parent | 2ca555c59517bca146ff617371292b8dbb5bd54e (diff) | |
download | askbot-29a2fe43934c163e0ae806ff086cdce45dd9882c.tar.gz askbot-29a2fe43934c163e0ae806ff086cdce45dd9882c.tar.bz2 askbot-29a2fe43934c163e0ae806ff086cdce45dd9882c.zip |
'Not sure if deleting this was a right thing to do as we don't want tags tag1 and TAG1 we always want a single case variant. If someone attempts to create a case variant we should auto-correct.'
reverting it
-rw-r--r-- | askbot/forms.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/askbot/forms.py b/askbot/forms.py index fcedda18..04efb1f3 100644 --- a/askbot/forms.py +++ b/askbot/forms.py @@ -380,13 +380,15 @@ def clean_tag(tag_name): ) if askbot_settings.FORCE_LOWERCASE_TAGS: - tag_name = tag_name.lower() - - if askbot_settings.FORCE_LOWERCASE_TAGS: #a simpler way to handle tags - just lowercase thew all return tag_name.lower() else: - return tag_name + try: + from askbot import models + stored_tag = models.Tag.objects.get(name__iexact=tag_name) + return stored_tag.name + except models.Tag.DoesNotExist: + return tag_name class TagNamesField(forms.CharField): |