dont store invalid entries

This commit is contained in:
j 2013-02-28 16:07:19 +05:30
parent 7c58590103
commit be5b7474e0

View file

@ -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',