Commits

Mitsukuni Sato committed d438617

Fix bug for correcting can't delete GridFS files.

  • Participants
  • Parent commits 629607f

Comments (0)

Files changed (1)

storages/backends/mongodb.py

         return force_unicode(name).strip().replace('\\', '/')
 
     def delete(self, name):
-        file = self.fs.delete(name)
+        f = self._open(name, 'r')
+        return self.fs.delete(f.file._id)
 
     def exists(self, name):
         try:
         raise NotImplementedError()
 
     def close(self):
-        self.file.close()
+        self.file.close()
+