Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
added happyforms to fix whitespaces; fix bug 690758
Browse files Browse the repository at this point in the history
  • Loading branch information
Jen Fong-Adwent committed Oct 6, 2011
1 parent a5e8843 commit 0ea1da6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
14 changes: 8 additions & 6 deletions apps/phonebook/forms.py
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions apps/phonebook/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')

Expand Down
3 changes: 2 additions & 1 deletion apps/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion vendor
Submodule vendor updated 4 files
+3 −0 .gitmodules
+1 −1 src/funfactory
+1 −0 src/happyforms
+1 −0 vendor.pth

0 comments on commit 0ea1da6

Please sign in to comment.