X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c2e8051452fa55db096553cbe5ae622fc363d481..190a12c5524f533a5fa74569575cccf22f745847:/src/sponsors/models.py?ds=sidebyside diff --git a/src/sponsors/models.py b/src/sponsors/models.py index 6e4ffe1f3..905631394 100644 --- a/src/sponsors/models.py +++ b/src/sponsors/models.py @@ -53,7 +53,8 @@ class SponsorPage(models.Model): offset -= THUMB_HEIGHT except KeyError: pass - result.append(result_group) + if result_group['sponsors']: + result.append(result_group) return result def render_sprite(self): @@ -95,7 +96,7 @@ class SponsorPage(models.Model): 'page': self }) ret = super(SponsorPage, self).save(*args, **kwargs) - cache.delete('sponsor_page:' + name) + cache.delete('sponsor_page:' + self.name) return ret def __str__(self):