Commits

Ivan Melnikov committed ae1b728 Draft

Fix auth cache logic

  • Participants
  • Parent commits a372dda

Comments (0)

Files changed (1)

 		grant = memcache.get(key)
 		if grant is None:
 			one = User.all().filter('user_id', user.user_id()).filter('approved !=', None).fetch(1)
-			if not one:
-				grant = False
-				self.redirect('/_docs/join.html')
-				return
-			else:
-				grant = True
-		memcache.set(key, grant)
+			grant = len(one) > 0
+			memcache.set(key, grant)
+
+		if not grant:
+			self.redirect('/_docs/join.html')
+			return
 
 		# execute method
 		return target(self, *args, **kwargs)