Update document page and document edit views to CBV.

This commit is contained in:
Roberto Rosario
2015-08-25 20:30:30 -04:00
parent 72c63bfedc
commit 82dbd87925
4 changed files with 84 additions and 71 deletions

View File

@@ -79,6 +79,15 @@ class DocumentForm(forms.ModelForm):
label=_('Quick document rename')
)
def clean(self):
if 'document_type_available_filenames' in self.cleaned_data:
if self.cleaned_data['document_type_available_filenames']:
self.cleaned_data['label'] = self.cleaned_data[
'document_type_available_filenames'
]
return self.cleaned_data
class DocumentPropertiesForm(DetailForm):
"""