Skip to content

Commit

Permalink
Make errors more readable in template
Browse files Browse the repository at this point in the history
Instead of printing the `repr()` of the row, leading to `OrderedDict([(u'col1', u'val1'), (u'col2', u'val2'), …])`, just print `val1, val2, …`.
  • Loading branch information
jnns committed Mar 2, 2016
1 parent 78a082f commit ab2c586
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions import_export/templates/admin/import_export/import.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ <h1>{% trans "Import" %}</h1>

<p>
{% trans "This importer will import the following fields: " %}
{% for f in fields %}
{% if forloop.counter0 %}
,
{% endif %}
<code>{{ f }}</code>
{% endfor %}
<code>{{ fields|join:", " }}</code>
</p>

<fieldset class="module aligned">
Expand Down Expand Up @@ -73,7 +68,7 @@ <h2>{% trans "Errors" %}</h2>
{% for error in errors %}
<li>
{% trans "Line number" %}: {{ line }} - {{ error.error }}
<div>{{ error.row }}</div>
<div><code>{{ error.row.values|join:", " }}</code></div>
<div class="traceback">{{ error.traceback|linebreaks }}</div>
</li>
{% endfor %}
Expand Down

0 comments on commit ab2c586

Please sign in to comment.