home / django_tickets / tickets

tickets: 8265

This data as json

id created changetime last_pulled_from_trac stage status component type severity version resolution summary description owner reporter keywords easy has_patch needs_better_patch needs_tests needs_docs ui_ux
8265 2008-08-12 20:47:43 2008-08-23 01:10:47 2022-03-06 03:41:47.750126 Unreviewed closed Template system     dev duplicate Debug template exception message is confuse When some error happens and the debug page for error 500 is shown with debug informations, the exception value is shown as a H2 element, like this: {{{ Caught an exception while rendering: The 'image' attribute has no file associated with it. Original Traceback (most recent call last): File "../django/django/template/debug.py", line 71, in render_node result = node.render(context) File "../django/django/template/defaulttags.py", line 148, in render nodelist.append(node.render(context)) File "../django/django/template/debug.py", line 87, in render output = force_unicode(self.filter_expression.resolve(context)) File "../django/django/template/__init__.py", line 518, in resolve obj = self.var.resolve(context) File "../django/django/template/__init__.py", line 659, in resolve value = self._resolve_lookup(context) File "../django/django/template/__init__.py", line 688, in _resolve_lookup current = getattr(current, bit) File "/arquivos/Trabalhos/WN/Cranes/cranes_com/apps/spares/models.py", line 108, in __getattr__ thumbnail = get_image_thumbnail_filename() File "/arquivos/Trabalhos/WN/Cranes/cranes_com/apps/spares/models.py", line 100, in get_image_thumbnail_filename file, ext = os.path.splitext(self.image.path) File "../django/django/db/models/fields/files.py", line 50, in _get_path self._require_file() File "../django/django/db/models/fields/files.py", line 40, in _require_file raise ValueError("The '%s' attribute has no file associated with it." % self.field.name) ValueError: The 'image' attribute has no file associated with it. }}} This is VERY confuse and make developer spent some time to find the error message and the file/line where the error occured. My suggestion is change the H2 tag to PRE, with some CSS changes, so, the line breaks are respected exactly as they are when Python raises the exception. nobody marinho   0 1 0 0 0 0
Powered by Datasette · Queries took 0.804ms