From ae40acd4f7a0a96dd51b89f9d7a2b4c5f59d6e5a Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 11 Sep 2012 05:21:20 -0400 Subject: [PATCH] Remove document version file field storage monkey patch --- apps/documents/post_init.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/documents/post_init.py b/apps/documents/post_init.py index 0fef11bb21..98c9b0ab92 100644 --- a/apps/documents/post_init.py +++ b/apps/documents/post_init.py @@ -16,7 +16,4 @@ def init_validate_cache_path(): setattr(document_settings, 'CACHE_PATH', tempfile.mkdtemp()) def init_set_storage_backend(): - # Monkey patch the file field until this is resolved: AttributeError: - # The 'file' attribute can only be accessed from DocumentVersion instances. - #DocumentVersion.file.storage = STORAGE_BACKEND() - DocumentVersion.add_to_class('file', models.FileField(upload_to=get_filename_from_uuid, verbose_name=_(u'file'), storage=STORAGE_BACKEND())) + DocumentVersion._meta.get_field('file').storage=STORAGE_BACKEND()