Skip to content
Browse files

Merge pull request #21 from alvesjnr/master

TmpStore bug fix
  • Loading branch information...
2 parents b0439fb + c67efba commit 2f07c4efaf99053bb7498f94cea1744a8880bba8 @alvesjnr alvesjnr committed Jun 10, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 isis/model/mapper.py
View
15 isis/model/mapper.py
@@ -191,6 +191,21 @@ def _pystruct(self, instance, value):
def _colander_schema(self, instance, value):
class MemoryTmpStore(dict):
+
+ def __getitem__(self, name):
+ return self.get(name)
+
+ def get(self, name):
+ item = super(MemoryTmpStore,self).get(name)
+
+ if item is not None and item['fp'] is not None:
+ if not item['fp'].read(100):
+ item['fp'] = None
+ else:
+ item['fp'].seek(0)
+
+ return item
+
def preview_url(self, name):
return None
tmpstore = MemoryTmpStore()

0 comments on commit 2f07c4e

Please sign in to comment.
Something went wrong with that request. Please try again.