working UGC content upload with multi-upload support
This commit is contained in:
@@ -21,7 +21,6 @@ class ProjectForm(forms.Form):
|
||||
'placeholder': 'Write the description in Markdown…',
|
||||
}),
|
||||
)
|
||||
thumbnail = forms.ImageField(required=False)
|
||||
caption = forms.CharField(
|
||||
max_length=128,
|
||||
required=False,
|
||||
@@ -35,19 +34,11 @@ class ProjectForm(forms.Form):
|
||||
|
||||
|
||||
class VersionForm(forms.Form):
|
||||
def __init__(self, *args, required_file=True, **kwargs):
|
||||
# The create flow uploads the version file out-of-band (temp upload),
|
||||
# so there the `file` field is optional in the bound form.
|
||||
super().__init__(*args, **kwargs)
|
||||
if not required_file:
|
||||
self.fields['file'].required = False
|
||||
|
||||
version_name = forms.CharField(
|
||||
max_length=64,
|
||||
label='Version',
|
||||
widget=forms.TextInput(attrs={'placeholder': 'e.g. 1.0.0'}),
|
||||
)
|
||||
file = forms.FileField(label='File')
|
||||
changelog = forms.CharField(
|
||||
required=False,
|
||||
widget=forms.Textarea(attrs={
|
||||
|
||||
Reference in New Issue
Block a user