From be267c476c4585f8572fc6a396d3717c68a6d07a Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 7 Feb 2011 14:33:58 -0400 Subject: [PATCH] Catch error when listing staging files fails --- apps/documents/forms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)