mirror of
https://github.com/django/django.git
synced 2025-10-25 22:56:12 +00:00
Fixed #1729 -- Changed get_FIELD_filename() to return an empty string when field fiel's value is null. Thanks, rhettg@gmail.com
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2839 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -281,7 +281,9 @@ class Model(object):
|
||||
return getattr(self, cachename)
|
||||
|
||||
def _get_FIELD_filename(self, field):
|
||||
return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
|
||||
if getattr(self, field.attname): # value is not blank
|
||||
return os.path.join(settings.MEDIA_ROOT, getattr(self, field.attname))
|
||||
return ''
|
||||
|
||||
def _get_FIELD_url(self, field):
|
||||
if getattr(self, field.attname): # value is not blank
|
||||
|
||||
Reference in New Issue
Block a user