diff options
Diffstat (limited to 'ishtar_common')
| -rw-r--r-- | ishtar_common/data_importer.py | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/ishtar_common/data_importer.py b/ishtar_common/data_importer.py index 481098244..834ba0ed9 100644 --- a/ishtar_common/data_importer.py +++ b/ishtar_common/data_importer.py @@ -21,6 +21,7 @@ import copy  import csv  import datetime  import io +import os  import logging  import re  import sys @@ -495,15 +496,13 @@ class FileFormater(Formater):          filename = settings.MEDIA_ROOT + 'imported/' + \              u".".join(items[:-1]) + u'.' + items[-1]          try: -            current_size = 0              with open(filename, 'w') as f:                  with zp.open(value) as z:                      f.write(z.read()) -                current_size = f.size              f = open(filename, 'r')              my_file = File(f)              # manualy set the file size because of an issue with TempFile -            my_file.size = current_size +            my_file.size = os.stat(filename).st_size              return my_file          except KeyError:              raise ValueError(_(u"\"%(value)s\" is not a valid path for the " | 
