[extensions-web] views: Fix update_info in the case of no proper version



commit 5330ef13ffe199b54dcb8cc0a3ac9e59cacbb81e
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jul 22 00:06:17 2013 -0400

    views: Fix update_info in the case of no proper version

 sweettooth/extensions/views.py |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/sweettooth/extensions/views.py b/sweettooth/extensions/views.py
index 56e10da..e7dbb77 100644
--- a/sweettooth/extensions/views.py
+++ b/sweettooth/extensions/views.py
@@ -107,13 +107,13 @@ def shell_update(request):
 
         proper_version = grab_proper_extension_version(extension, shell_version)
 
-        if version < proper_version.version:
-            operations[uuid] = "upgrade"
-        elif version_obj.status == models.STATUS_REJECTED:
-            if proper_version is not None:
+        if proper_version is not None:
+            if version < proper_version.version:
+                operations[uuid] = "upgrade"
+            elif version_obj.status == models.STATUS_REJECTED:
                 operations[uuid] = "downgrade"
-            else:
-                operations[uuid] = "blacklist"
+        else:
+            operations[uuid] = "blacklist"
 
     return operations
 


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