from io import BytesIO
from django.core.cache import cache
from django.db import models
-from django.utils.translation import ugettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from django.template.loader import render_to_string
from PIL import Image
offset -= THUMB_HEIGHT
except KeyError:
pass
- result.append(result_group)
+ if result_group['sponsors']:
+ result.append(result_group)
return result
def render_sprite(self):
'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):