Ticket #1729: NullPath.diff

File NullPath.diff, 637 bytes (added by rhettg@…, 19 years ago)
  • db/models/base.py

     
    282282        return getattr(self, cachename)
    283283
    284284    def _get_FIELD_filename(self, field):
    285         return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
     285        if getattr(self, field.attname):
     286            return os.path.join(settings.MEDIA_ROOT,
     287                                getattr(self, field.attname))
     288        return ''
    286289
    287290    def _get_FIELD_url(self, field):
    288291        if getattr(self, field.attname): # value is not blank
Back to Top