check that url actually served an image
This commit is contained in:
parent
6e9110eb42
commit
6344be480e
1 changed files with 7 additions and 0 deletions
|
@ -79,6 +79,13 @@ class PosterCache(models.Model):
|
||||||
self.status = e.reason
|
self.status = e.reason
|
||||||
self.failed = True
|
self.failed = True
|
||||||
self.save()
|
self.save()
|
||||||
|
if self.image:
|
||||||
|
try:
|
||||||
|
self.image.width
|
||||||
|
except TypeError:
|
||||||
|
self.failed = True
|
||||||
|
self.status = "invalid image"
|
||||||
|
self.image.delete()
|
||||||
return self.image
|
return self.image
|
||||||
|
|
||||||
class Poster(models.Model):
|
class Poster(models.Model):
|
||||||
|
|
Loading…
Reference in a new issue