Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite42eb42

Browse files
dvarrazzolovelydinosaur
authored andcommitted
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 withempty content is forbidden by javascript, with the message "Please fillin this field". Filling the form with '{}' allows an application/jsonrequest to be submitted.The API call itself works perfectly well with a post with empty content:the interface shouldn't make assumptions about it.
1 parent7cd5914 commite42eb42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎rest_framework/renderers.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,8 @@ class GenericContentForm(forms.Form):
579579
_content=forms.CharField(
580580
label='Content',
581581
widget=forms.Textarea(attrs={'data-override':'content'}),
582-
initial=content
582+
initial=content,
583+
required=False
583584
)
584585

585586
returnGenericContentForm()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp