diff --git a/oxdata/poster/models.py b/oxdata/poster/models.py index 5439c14..56dcdff 100644 --- a/oxdata/poster/models.py +++ b/oxdata/poster/models.py @@ -75,7 +75,10 @@ class PosterCache(models.Model): name = hashlib.sha1(url).hexdigest() try: data = ox.net.readUrl(url) - self.image.save(name, ContentFile(data)) + self.image.name = poster.models.poster_path(self.url, 'image.jpg') + with open(self.image.path, 'w') as f: + f.write(data) + self.save() except ox.net.urllib2.HTTPError, e: #import traceback #print traceback.print_exc()