[extensions-web] views: Allow superusers to bypass the creator check



commit cf547df5363403e27bac0da02426fb5f6c6f6046
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Jan 18 11:12:21 2013 -0500

    views: Allow superusers to bypass the creator check

 sweettooth/extensions/views.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index f61e9e0..70b8d2d 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -370,7 +370,7 @@ def create_version(request, file_source):
     except models.Extension.DoesNotExist:
         extension = models.Extension(creator=request.user)
     else:
-        if request.user != extension.creator:
+        if request.user != extension.creator and not request.user.is_superuser:
             messages.error(request, "An extension with that UUID has already been added.")
             transaction.rollback()
             return None, []



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