Revert to old list method until we start updating the cache.
authorEric Price <ecprice@mit.edu>
Wed, 14 Nov 2007 01:18:32 +0000 (20:18 -0500)
committerEric Price <ecprice@mit.edu>
Wed, 14 Nov 2007 01:18:32 +0000 (20:18 -0500)
Fix a bug in getafsgroups.

svn path=/trunk/web/; revision=246

getafsgroups.py
main.py

index 2de20bc..899de81 100644 (file)
@@ -76,8 +76,8 @@ def notLockerOwner(user, locker):
         return str(e)
 
     for entry in values:
         return str(e)
 
     for entry in values:
-        if entry[0] == user or (entry[0][0:6] == "system" and 
-                                checkAfsGroup(user, entry[0], cell)):
+        if entry == user or (entry[0:6] == "system" and 
+                                checkAfsGroup(user, entry, cell)):
             return False
     return "You don't have admin bits on /mit/" + locker
 
             return False
     return "You don't have admin bits on /mit/" + locker
 
diff --git a/main.py b/main.py
index 29b410e..e8d199d 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -184,8 +184,12 @@ def create(user, fields):
 
 
 def getListDict(user):
 
 
 def getListDict(user):
-    machines = [m for m in Machine.select() 
-                if validation.haveAccess(user, m)]    
+    machines = [m for m in Machine.select()
+                if validation.haveAccess(user, m)]
+    #if user == 'moo':
+    #    machines = Machine.select()
+    #else:
+    #    machines = Machine.query().join('users').filter_by(user=user).all()
     checkpoint.checkpoint('Got my machines')
     on = {}
     has_vnc = {}
     checkpoint.checkpoint('Got my machines')
     on = {}
     has_vnc = {}