summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-04 23:08:48 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-04 23:08:48 -0400
commit54891e1576a3b8ad96fcfa159c5eaf5ab9cd2446 (patch)
tree821c8b05928385ec2d85de4a7fc66c91cf619ee5
parent1daf6385d622eb73201eb8e0f2485ebfce254918 (diff)
downloadaskbot-54891e1576a3b8ad96fcfa159c5eaf5ab9cd2446.tar.gz
askbot-54891e1576a3b8ad96fcfa159c5eaf5ab9cd2446.tar.bz2
askbot-54891e1576a3b8ad96fcfa159c5eaf5ab9cd2446.zip
small change in the PostAsSomeone form
-rw-r--r--askbot/forms.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/askbot/forms.py b/askbot/forms.py
index 1ef8cefa..04efb1f3 100644
--- a/askbot/forms.py
+++ b/askbot/forms.py
@@ -868,16 +868,16 @@ class PostAsSomeoneForm(forms.Form):
todo: maybe better to have field where initial value is invalid,
then we would not have to have two almost identical clean functions?
"""
- username = self.cleaned_data.get('post_author_username', '')
+ username = self.cleaned_data.get('post_author_username', '').strip()
initial_username = unicode(self.fields['post_author_username'].initial)
- if username == initial_username:
+ if username and username == initial_username:
self.cleaned_data['post_author_username'] = ''
return self.cleaned_data['post_author_username']
def clean_post_author_email(self):
"""if value is the same as initial, it is reset to
empty string"""
- email = self.cleaned_data.get('post_author_email', '')
+ email = self.cleaned_data.get('post_author_email', '').strip()
initial_email = unicode(self.fields['post_author_email'].initial)
if email == initial_email:
email = ''