[extensions-web/ui-cleanup: 2/12] upload: Don't create a new, blank form when we've failed validation



commit 0c6085db4e8a98ae93d665fa31937492d9b0b25c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jan 5 15:31:45 2012 -0500

    upload: Don't create a new, blank form when we've failed validation
    
    For the user's convenience, keep the form the same as it was when
    we've failed validation.

 sweettooth/extensions/views.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index dd855a7..1019f87 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -411,7 +411,9 @@ def upload_file(request, pk):
                                 ext_pk=extension.pk,
                                 slug=extension.slug)
 
-    form = UploadForm()
+    else:
+        form = UploadForm()
+
     return render(request, 'extensions/upload.html', dict(form=form,
                                                           errors=errors,
                                                           extra_debug=extra_debug))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]