set filesize

pull/43/head
eric 2017-03-23 13:30:05 -04:00
parent e8f546e9c4
commit ad8de40cd7
1 changed files with 3 additions and 0 deletions

View File

@ -1096,6 +1096,9 @@ class Ebook(models.Model):
logger.error(u'could not open {}'.format(self.url))
else:
ebf = self.ebook_files.filter(asking=False).order_by('-created')[0]
if not self.filesize:
self.filesize = ebf.file.size
self.save()
return ebf
def set_provider(self):