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:
parent
adf6126c81
commit
775c06a959
1
AUTHORS
1
AUTHORS
|
@ -97,6 +97,7 @@ answer newbie questions, and generally made Django that much better:
|
|||
Daniel Poelzleithner <http://poelzi.org/>
|
||||
J. Rademaker
|
||||
Brian Ray <http://brianray.chipy.org/>
|
||||
rhettg@gmail.com
|
||||
Oliver Rutherfurd <http://rutherfurd.net/>
|
||||
Ivan Sagalaev (Maniac) <http://www.softwaremaniacs.org/>
|
||||
David Schein
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue