changeset 14:645aa0f3279f

userland refactoring...still lives on request, sadly, but better
author k0s <k0scist@gmail.com>
date Wed, 07 Oct 2009 17:26:13 -0400
parents fbf8f198ef67
children 36698624435b
files bitsyblog/bitsyblog.py
diffstat 1 files changed, 7 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/bitsyblog/bitsyblog.py	Wed Oct 07 17:19:47 2009 -0400
+++ b/bitsyblog/bitsyblog.py	Wed Oct 07 17:26:13 2009 -0400
@@ -146,7 +146,7 @@
     def get_user_space(self, user, path, request):
         """returns a part of the user space"""
 
-        request.user = self.users[user] # user whose blog is viewed
+#        request.user = self.users[user] # user whose blog is viewed
         check = self.check_user(user, request) # is this the authenticated user?
 
         feed = None # not an rss/atom feed by default (flag)
@@ -234,8 +234,6 @@
 
         ### user space
         user, path = self.userpath(request)
-        if user not in self.users:
-            return exc.HTTPNotFound("No blog found for %s" % user)
 
         return self.get_user_space(user, path, request)
 
@@ -248,10 +246,6 @@
         # find user + path
         user, path = self.userpath(request)
 
-        if user not in self.users:
-            return exc.HTTPNotFound("No blog found for %s" % user)
-        request.user = self.users[user]
-
         check = self.check_user(user)
         if check is not None:
             return check
@@ -384,7 +378,11 @@
         path = request.path_info.strip('/').split('/')
         name = path[0]
         path = path[1:]
-        if not name:
+        if name:
+            if name not in self.users:
+                exc.HTTPNotFound("No blog found for %s" % user)
+            request.user = self.users[name]
+        else:
             name = None
         return name, path
 
@@ -861,6 +859,7 @@
         path = request.path_info.strip('/').split('/')
         if path == ['']:
             path = []
+        request.user = self.users[self.user]
         return self.user, path
 
     def user_url(self, request, user, *args, **kw):