Skip to content

Commit

Permalink
allow empty attachments and images.
Browse files Browse the repository at this point in the history
  • Loading branch information
a7p committed Aug 25, 2013
1 parent fa9b120 commit 446d629
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flatpages_filer/models.py
Expand Up @@ -31,8 +31,8 @@ class FlatPageImage(models.Model):
image = FilerImageField(null=True, blank=True)

def __unicode__(self):

return "![%s][%s]" % (self.image.label, self.image.pk)
if self.image:
return "![%s][%s]" % (self.image.label, self.image.pk)

class Meta:
verbose_name = "Image"
Expand All @@ -47,8 +47,8 @@ class FlatPageAttachment(models.Model):
attachment = FilerFileField(null=True, blank=True)

def __unicode__(self):

return "[%s] [%s]" % (self.attachment.label, self.attachment.pk)
if self.attachment:
return "[%s] [%s]" % (self.attachment.label, self.attachment.pk)

class Meta:
verbose_name = "Attachment"
Expand Down

0 comments on commit 446d629

Please sign in to comment.