diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-08-10 01:07:40 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-08-10 01:07:40 +0000 |
| commit | 38dc472796eb4560d6408f4f2fd94298738794d1 (patch) | |
| tree | 8cf1d556d141fe22791113dcba00ea975262928e /django/contrib/admin/widgets.py | |
| parent | 049d490875e8bcbc5977d4d63acff432a7ec824e (diff) | |
Fixed #7250 -- Don't show internal data of a FileField in the admin when the form does not validate. This also alternatively fixes a recent problem since [8244] when the form is not valid. Thanks Marc Garcia for the initial ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/admin/widgets.py')
| -rw-r--r-- | django/contrib/admin/widgets.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py index 13c7c9cf01..2bfbc9715d 100644 --- a/django/contrib/admin/widgets.py +++ b/django/contrib/admin/widgets.py @@ -84,7 +84,7 @@ class AdminFileWidget(forms.FileInput): def render(self, name, value, attrs=None): output = [] - if value: + if value and hasattr(value, "url"): output.append('%s <a target="_blank" href="%s">%s</a> <br />%s ' % \ (_('Currently:'), value.url, value, _('Change:'))) output.append(super(AdminFileWidget, self).render(name, value, attrs)) |
