def root(self, r, url): user = cur_user(r) if user is None: return HttpResponseRedirect('/login') args = url.split("/") action, args = args[0], args[1:] try: action_args = [r, user, ] action = self.actions.get(action, self.my_groups) return action(*action_args) except Exception, e: print "%s\n%s" %(e, traceback.format_exc()) raise
def root(self, r, url): user = cur_user(r) if user is None: return HttpResponseRedirect('/login') args = url.split("/") action, args = args[0], args[1:] try: action_args = [r, user, ] if len(args) > 0: action_args.append(Group.load(args[0])) args.remove(args[0]) if not self.is_member(user, action_args[-1]) and 'join' != action: return self.group_guest(*action_args) action_args.extend(args) action = self.actions.get(action, self.group_unkown) return action(*action_args) except Exception, e: logging.error(str(e)) raise