diff --git a/apps/documents/forms.py b/apps/documents/forms.py index 8c237539df..5c6c78f9c4 100644 --- a/apps/documents/forms.py +++ b/apps/documents/forms.py @@ -53,7 +53,11 @@ class DocumentForm_edit(DocumentForm): class StagingDocumentForm(forms.Form): def __init__(self, *args, **kwargs): super(StagingDocumentForm, self).__init__(*args, **kwargs) - self.fields['staging_file_id'].choices=[(staging_file.id, staging_file) for staging_file in StagingFile.get_all()] + try: + self.fields['staging_file_id'].choices=[(staging_file.id, staging_file) for staging_file in StagingFile.get_all()] + except: + pass + if 'initial' in kwargs: if 'document_type' in kwargs['initial']: filenames_qs = kwargs['initial']['document_type'].documenttypefilename_set.filter(enabled=True)