Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added happyforms to fix whitespaces; fix bug 690758

  • Loading branch information...
commit 0ea1da6de8942f833d0933278923e1176dc395f1 1 parent a5e8843
@ednapiranha ednapiranha authored
View
14 apps/phonebook/forms.py
@@ -1,19 +1,21 @@
+import tempfile
+
from django import forms
from django.conf import settings
+import happyforms
import Image
-import tempfile
from easy_thumbnails import processors
from tower import ugettext as _, ugettext_lazy as _lazy
from phonebook.models import Invite
-class SearchForm(forms.Form):
+class SearchForm(happyforms.Form):
q = forms.CharField(widget=forms.HiddenInput, required=True)
-class ProfileForm(forms.Form):
+class ProfileForm(happyforms.Form):
first_name = forms.CharField(label=_lazy(u'First Name'), required=False)
last_name = forms.CharField(label=_lazy(u'Last Name'), required=True)
biography = forms.CharField(label=_lazy(u'Bio'),
@@ -65,16 +67,16 @@ def clean_photo(self):
return photo
-class DeleteForm(forms.Form):
+class DeleteForm(happyforms.Form):
unique_id = forms.CharField(widget=forms.HiddenInput)
-class VouchForm(forms.Form):
+class VouchForm(happyforms.Form):
"""Vouching is captured via a user's unique_id."""
voucher = forms.CharField(widget=forms.HiddenInput)
vouchee = forms.CharField(widget=forms.HiddenInput)
-class InviteForm(forms.ModelForm):
+class InviteForm(happyforms.ModelForm):
class Meta:
model = Invite
View
3  apps/phonebook/tests/test_views.py
@@ -110,7 +110,9 @@ def test_anonymous_or_pending_search(self):
def test_mozillian_search(self):
url = reverse('phonebook.search')
r = self.mozillian_client.get(url, dict(q='Am'))
+ rs = self.mozillian_client.get(url, dict(q=' Am'))
peeps = r.context['people']
+ peeps_ws = rs.context['people']
saw_amandeep = saw_amanda = False
for person in peeps:
@@ -124,6 +126,7 @@ def test_mozillian_search(self):
saw_amanda = True
if saw_amandeep and saw_amanda:
break
+ self.assertEqual(peeps[0].full_name, peeps_ws[0].full_name)
self.assertTrue(saw_amandeep, 'We see Mozillians')
self.assertTrue(saw_amanda, 'We see Pending')
View
3  apps/users/forms.py
@@ -7,6 +7,7 @@
from django.utils.http import int_to_base36
import commonware.log
+import happyforms
from tower import ugettext as _, ugettext_lazy as _lazy
import larper
@@ -56,7 +57,7 @@ def clean(self):
return self.cleaned_data
-class RegistrationForm(forms.Form):
+class RegistrationForm(happyforms.Form):
email = forms.EmailField(label=_lazy(u'Primary Email'), required=True)
password = forms.CharField(min_length=8, max_length=255,
label=_lazy(u'Password'), required=True,
2  vendor
@@ -1 +1 @@
-Subproject commit 785a6dcf5df6f4c12fae9fc38e5a02f28fab2feb
+Subproject commit c3894400096f0518dafe357f37b50324c2a6369e
Please sign in to comment.
Something went wrong with that request. Please try again.