@@ -35,7 +35,7 @@ class UploadMaterialForm(forms.Form):
3535 name = forms .CharField (max_length = Document ._meta .get_field ("name" ).max_length )
3636 abstract = forms .CharField (max_length = Document ._meta .get_field ("abstract" ).max_length ,widget = forms .Textarea )
3737 state = forms .ModelChoiceField (State .objects .all (), empty_label = None )
38- material = forms .FileField (label = 'File' , help_text = "PDF or text file (ASCII/UTF-8)" )
38+ material = forms .FileField (label = 'File' )
3939
4040 def __init__ (self , doc_type , action , group , doc , * args , ** kwargs ):
4141 super (UploadMaterialForm , self ).__init__ (* args , ** kwargs )
@@ -60,9 +60,10 @@ def __init__(self, doc_type, action, group, doc, *args, **kwargs):
6060 if doc .get_state_slug () == "deleted" :
6161 self .fields ["state" ].help_text = "Note: If you wish to revise this document, you may wish to change the state so it's not deleted."
6262
63- for fieldname in ["title" ,"state" ,"material" ,"abstract" ]:
64- if fieldname != action :
65- del self .fields [fieldname ]
63+ if action in ["title" ,"state" ,"abstract" ]:
64+ for fieldname in ["title" ,"state" ,"material" ,"abstract" ]:
65+ if fieldname != action :
66+ del self .fields [fieldname ]
6667
6768 def clean_name (self ):
6869 name = self .cleaned_data ["name" ].strip ().rstrip ("-" )
0 commit comments