Commits

Waldemar Kornewald  committed 3f6d515

fixed blobstore backend on production server

  • Participants
  • Parent commits 88b6d75

Comments (0)

Files changed (1)

             data = content.file.blobstore_info
         elif hasattr(content, 'blobstore_info'):
             data = content.blobstore_info
-        elif hasattr(content, 'chunks'):
-            data = ''.join(chunk for chunk in content.chunks())
         else:
-            data = content.read()
+            raise ValueError("The App Engine storage backend only supports "
+                             "BlobstoreFile instances or File instances "
+                             "whose file attribute is a BlobstoreFile.")
 
         if isinstance(data, (BlobInfo, BlobKey)):
             # We change the file name to the BlobKey's str() value
 
     def new_file(self, *args, **kwargs):
         super(BlobstoreFileUploadHandler, self).new_file(*args, **kwargs)
-        access_type = self.content_type_extra.get('access-type')
         blobkey = self.content_type_extra.get('blob-key')
-        self.active = access_type == 'X-AppEngine-BlobKey'
+        self.active = blobkey is not None
         if self.active:
             self.blobkey = BlobKey(blobkey)
             raise StopFutureHandlers()