diff options
Diffstat (limited to 'askbot/forms.py')
-rw-r--r-- | askbot/forms.py | 6 |
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 = '' |