reset values

This commit is contained in:
j 2016-11-18 14:10:44 +02:00
parent d5902e2437
commit ef075ffb78
1 changed files with 3 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class Imdb(models.Model):
return data
def update(self, timeout=None):
if timeout != None:
if timeout is not None:
info = ox.web.imdb.ImdbCombined(self.imdb, timeout=timeout)
else:
info = ox.web.imdb.ImdbCombined(self.imdb)
@ -122,6 +122,8 @@ class Imdb(models.Model):
if isinstance(value, str):
value = normalize_value(value)
setattr(self, key, value)
else:
setattr(self, key, '')
if self.season and self.season < 0:
self.season = None
if self.episode and self.episode < 0: