[extensions-web] extensions: Fix a 500 error that can happen if a duplicate UUID



commit c46816a8f387144e9b5f5c2f7c177dee266312f3
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Dec 18 04:48:48 2012 -0500

    extensions: Fix a 500 error that can happen if a duplicate UUID
    
    We weren't rolling back the transaction here, causing the decorator
    to error out the site, as it should.

 sweettooth/extensions/views.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 64466c5..f61e9e0 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -372,6 +372,7 @@ def create_version(request, file_source):
     else:
         if request.user != extension.creator:
             messages.error(request, "An extension with that UUID has already been added.")
+            transaction.rollback()
             return None, []
 
     extension.parse_metadata_json(metadata)



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