reset values
This commit is contained in:
parent
d5902e2437
commit
ef075ffb78
1 changed files with 3 additions and 1 deletions
|
@ -108,7 +108,7 @@ class Imdb(models.Model):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def update(self, timeout=None):
|
def update(self, timeout=None):
|
||||||
if timeout != None:
|
if timeout is not None:
|
||||||
info = ox.web.imdb.ImdbCombined(self.imdb, timeout=timeout)
|
info = ox.web.imdb.ImdbCombined(self.imdb, timeout=timeout)
|
||||||
else:
|
else:
|
||||||
info = ox.web.imdb.ImdbCombined(self.imdb)
|
info = ox.web.imdb.ImdbCombined(self.imdb)
|
||||||
|
@ -122,6 +122,8 @@ class Imdb(models.Model):
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = normalize_value(value)
|
value = normalize_value(value)
|
||||||
setattr(self, key, value)
|
setattr(self, key, value)
|
||||||
|
else:
|
||||||
|
setattr(self, key, '')
|
||||||
if self.season and self.season < 0:
|
if self.season and self.season < 0:
|
||||||
self.season = None
|
self.season = None
|
||||||
if self.episode and self.episode < 0:
|
if self.episode and self.episode < 0:
|
||||||
|
|
Loading…
Reference in a new issue