dont store invalid entries
This commit is contained in:
parent
7c58590103
commit
be5b7474e0
1 changed files with 4 additions and 1 deletions
|
@ -83,7 +83,10 @@ class Imdb(models.Model):
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
super(Imdb, self).save(*args, **kwargs)
|
super(Imdb, self).save(*args, **kwargs)
|
||||||
|
if not self.invalid:
|
||||||
Match.update_item(self)
|
Match.update_item(self)
|
||||||
|
else:
|
||||||
|
Match.objects.filter(item=self).delete()
|
||||||
|
|
||||||
keys = ('title', 'director', 'year', 'season', 'episode',
|
keys = ('title', 'director', 'year', 'season', 'episode',
|
||||||
'originalTitle',
|
'originalTitle',
|
||||||
|
|
Loading…
Reference in a new issue