[extensions-web] Add extra debug information to failed uploads
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Add extra debug information to failed uploads
- Date: Sun, 11 Dec 2011 18:47:51 +0000 (UTC)
commit d2328718cc9ff2f179711e061f278f8d7e555bb4
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Dec 11 13:47:26 2011 -0500
Add extra debug information to failed uploads
.../extensions/templates/extensions/upload.html | 5 +++++
sweettooth/extensions/views.py | 5 ++++-
2 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/extensions/templates/extensions/upload.html b/sweettooth/extensions/templates/extensions/upload.html
index a485163..4b7f43a 100644
--- a/sweettooth/extensions/templates/extensions/upload.html
+++ b/sweettooth/extensions/templates/extensions/upload.html
@@ -7,6 +7,11 @@
{{ error }}
</p>
{% endfor %}
+ {% if extra_debug %}
+ <p class="message info">
+ Debug information: {{ extra_debug }}
+ </p>
+ {% endif %}
{% endblock %}
{% block body %}
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 6ea2cad..d3d9324 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -312,6 +312,7 @@ def upload_file(request, pk):
return HttpResponseForbidden()
errors = []
+ extra_debug = None
if request.method == 'POST':
form = UploadForm(request.POST, request.FILES)
@@ -351,6 +352,7 @@ def upload_file(request, pk):
except ValidationError, e:
is_valid = False
errors = e.messages
+ extra_debug = repr(e)
else:
is_valid = True
@@ -371,4 +373,5 @@ def upload_file(request, pk):
form = UploadForm()
return render(request, 'extensions/upload.html', dict(form=form,
- errors=errors))
+ errors=errors,
+ extra_debug=extra_debug))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]