﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
8361	instance.content.url should return empty string if no file associated	Jesaja Everling	nobody	"Hello everybody.
Due to the File storage refactoring, urls of ImageFields can now be retrieved not by using

instance.get_content_url(),
but rather by

instance.content.url

At the moment, if there is no file associated with the FileField, an exception is thrown.
In my opinion, this is not optimal.
Previously, you could do something like this in the template:

{{{
{% if instance.get_content_url %}
<img src=""/userimages/instance.get_content_url"">
{% else %}
<img src=""/userimages/default.jpg"">
{% endif %}
}}}

If you try to do this with instance.content.url, you get an exception.
I think it would be better, if just an empty string would be returned.

$DJANGOPATH\db\models\fields\files.py line 55
{{{
        self._require_file()
}}}

should become something like that:
{{{
        try:
            self._require_file()
        except:
            return """"
}}}

This probably isn't the most elegant way to do this, but it seems to work..."		closed	File uploads/storage	dev		invalid	File storage refactoring File get_FIELD_url		Unreviewed	1	0	0	0	0	0
