Skip to content

Commit

Permalink
Merge branch 'master' of heroku.com:djangosnippets
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Jul 31, 2012
2 parents 514d531 + 4cc0bfe commit 8e44991
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions cab/comments/forms.py
Expand Up @@ -3,10 +3,12 @@


class CapCommentForm(CommentForm):
name = forms.CharField(label='Your Name', required=False,
pass

your_name = forms.CharField(label='Your Name', required=False,
widget=forms.TextInput(attrs={'autocomplete': 'off'}))

def clean(self):
if self.cleaned_data.get('name'):
if self.cleaned_data.get('your_name'):
raise forms.ValidationError('Please keep the Name field blank')
return self.cleaned_data
return self.cleaned_data
4 changes: 2 additions & 2 deletions cab/forms.py
Expand Up @@ -54,10 +54,10 @@ def search(self):


class RegisterForm(RegistrationFormUniqueEmail):
name = forms.CharField(label='Your Name', required=False,
your_name = forms.CharField(label='Your Name', required=False,
widget=forms.TextInput(attrs={'autocomplete': 'off'}))

def clean(self):
if self.cleaned_data.get('name'):
if self.cleaned_data.get('your_name'):
raise forms.ValidationError('Please keep the Name field blank')
return self.cleaned_data
Expand Up @@ -15,7 +15,7 @@
{{ field }}
{% else %}
{% if field.errors %}{{ field.errors }}{% endif %}
<tr {% ifequal field.name "name" %} class="bee-like-this"{% endifequal %}>
<tr {% ifequal field.name "your_name" %} class="bee-like-this"{% endifequal %}>
<td{% if field.errors %} class="error"{% endif %}>
{{ field.label_tag }}
</td>
Expand Down

0 comments on commit 8e44991

Please sign in to comment.