Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit 775c06a959bfd1e156810b632604abf845f11be8 1 parent adf6126
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 1 deletion.
  1. +1 −0  AUTHORS
  2. +3 −1 django/db/models/base.py
View
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
View
4 django/db/models/base.py
@@ -281,7 +281,9 @@ def _get_next_or_previous_in_order(self, is_next):
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

0 comments on commit 775c06a

Please sign in to comment.
Something went wrong with that request. Please try again.