Permalink
Browse files

Default images.

  • Loading branch information...
1 parent e5f1157 commit c5867fed9bfe30349e2a2f77bc5dee002a4be816 James Cleveland committed Aug 14, 2012
Showing with 5 additions and 2 deletions.
  1. +1 −0 brightonfemcol/settings.py
  2. +2 −1 suave_calendar/models.py
  3. +2 −1 suave_press/models.py
View
1 brightonfemcol/settings.py
@@ -34,6 +34,7 @@
THUMBNAIL_COLORSPACE = None
THUMBNAIL_FORMAT = 'PNG'
+DEFAULT_IMAGE = 'default-image.png'
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
View
3 suave_calendar/models.py
@@ -6,6 +6,7 @@
from model_utils.managers import PassThroughManager
from suave.models import Displayable, Ordered, Image, SiteEntityQuerySet
+from suave.utils import get_default_image
class EventQuerySet(SiteEntityQuerySet):
@@ -51,7 +52,7 @@ def image(self):
try:
return self.images.all()[0]
except IndexError:
- return None
+ return get_default_image()
class EventLink(Ordered):
View
3 suave_press/models.py
@@ -8,6 +8,7 @@
from model_utils.fields import StatusField
from suave.models import Displayable, SiteEntityQuerySet, Image
+from suave.utils import get_default_image
class Category(Displayable):
@@ -57,7 +58,7 @@ def image(self):
try:
return self.images.all()[0]
except IndexError:
- return None
+ return get_default_image()
class ArticleImage(Image):

0 comments on commit c5867fe

Please sign in to comment.