Skip to content

Commit

Permalink
label and css_extra fields on pageblock edit form should not be required
Browse files Browse the repository at this point in the history
  • Loading branch information
thraxil committed Mar 29, 2016
1 parent d99408d commit c67c3e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pagetree/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,14 @@ def default_edit_form(self):
class EditForm(forms.Form):
label = forms.CharField(
initial=self.label,
required=False,
widget=forms.TextInput(
attrs={'id': 'id_label_%d' % self.pk}
))
css_extra = forms.CharField(
initial=self.css_extra,
label='extra CSS classes',
required=False,
widget=forms.TextInput(
attrs={'id': 'id_css_extra_%d' % self.pk}
))
Expand Down
2 changes: 2 additions & 0 deletions pagetree/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def test_default_edit_form(self):
self.assertEqual(
"css_extra" in f.fields,
True)
self.assertFalse(f.fields['label'].required)
self.assertFalse(f.fields['css_extra'].required)

def test_edit(self):
b = self.section1.pageblock_set.all()[0]
Expand Down

0 comments on commit c67c3e8

Please sign in to comment.