Commit e42eb42d by Daniele Varrazzo Committed by Tom Christie

Don't make the content mandatory in the generic content form (#5372)

Sometimes, probably in the upgrade from Django 1.9 to 1.10, a post with
empty content is forbidden by javascript, with the message "Please fill
in this field". Filling the form with '{}' allows an application/json
request to be submitted.

The API call itself works perfectly well with a post with empty content:
the interface shouldn't make assumptions about it.
parent 7cd59147
...@@ -579,7 +579,8 @@ class BrowsableAPIRenderer(BaseRenderer): ...@@ -579,7 +579,8 @@ class BrowsableAPIRenderer(BaseRenderer):
_content = forms.CharField( _content = forms.CharField(
label='Content', label='Content',
widget=forms.Textarea(attrs={'data-override': 'content'}), widget=forms.Textarea(attrs={'data-override': 'content'}),
initial=content initial=content,
required=False
) )
return GenericContentForm() return GenericContentForm()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment