fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Search
[wolnelektury.git]
/
src
/
sponsors
/
models.py
diff --git
a/src/sponsors/models.py
b/src/sponsors/models.py
index
6e4ffe1
..
704b066
100644
(file)
--- a/
src/sponsors/models.py
+++ b/
src/sponsors/models.py
@@
-6,7
+6,7
@@
import time
from io import BytesIO
from django.core.cache import cache
from django.db import models
from io import BytesIO
from django.core.cache import cache
from django.db import models
-from django.utils.translation import
u
gettext_lazy as _
+from django.utils.translation import gettext_lazy as _
from django.template.loader import render_to_string
from PIL import Image
from django.template.loader import render_to_string
from PIL import Image
@@
-53,7
+53,8
@@
class SponsorPage(models.Model):
offset -= THUMB_HEIGHT
except KeyError:
pass
offset -= THUMB_HEIGHT
except KeyError:
pass
- result.append(result_group)
+ if result_group['sponsors']:
+ result.append(result_group)
return result
def render_sprite(self):
return result
def render_sprite(self):
@@
-95,7
+96,7
@@
class SponsorPage(models.Model):
'page': self
})
ret = super(SponsorPage, self).save(*args, **kwargs)
'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):
return ret
def __str__(self):