[extensions-web] upload: Don't use a savepoint



commit 7f7d563c04eb0ff3186c05bdb95fef9d5c5f2883
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Mar 4 12:40:04 2012 -0500

    upload: Don't use a savepoint
    
    There aren't any DB operations before the savepoint, so
    just remove it.

 sweettooth/extensions/views.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 62c7676..903674f 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -368,8 +368,6 @@ def upload_file(request):
         if form.is_valid():
             file_source = form.cleaned_data['source']
 
-            sid = transaction.savepoint()
-
             try:
                 metadata = models.parse_zipfile_metadata(file_source)
                 uuid = metadata['uuid']
@@ -397,9 +395,9 @@ def upload_file(request):
                     errors = e.messages
 
                 extra_debug = repr(e)
-                transaction.savepoint_rollback(sid)
+                transaction.rollback()
             else:
-                transaction.savepoint_commit(sid)
+                transaction.commit()
 
                 version = models.ExtensionVersion.objects.create(extension=extension,
                                                                  source=file_source,



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