示例#1
0
    def get(self):
        user = users.get_current_user()

        if user:
            wiki = Wiki.getByUser(user)
            self.redirect(wiki.getUrl())
        else:
            self.redirect('/')
示例#2
0
	def get(self):
		user = users.get_current_user()

		if user:
			wiki = Wiki.getByUser(user)
			self.redirect(wiki.getUrl())
		else:
			self.redirect('/')
示例#3
0
文件: index.py 项目: yanzay/zen-wiki
	def get(self):
		
		wiki = None
		user = users.get_current_user()
		if user:
			wiki = Wiki.getByUser(user)
		
		self.response.out.write(template.render('templates/index.html', {
			'user':       user,
			'logout_url': users.create_logout_url(self.request.path),
			'login_url':  users.create_login_url('/_onlogin'),
			'wiki':       wiki
		}))
示例#4
0
	def get(self):
		if self.request.host.find("appspot") != -1 and self.request.url.find("https") != 0: # if on appspot.com and not in ssl mode
			self.redirect("http://www.zen-wiki.com" + self.request.path)

		wiki = None
		user = users.get_current_user()
		if user:
			wiki = Wiki.getByUser(user)

		self.response.out.write(template.render('templates/index.html', {
			'user':       user,
			'logout_url': users.create_logout_url(self.request.path),
			'login_url':  users.create_login_url('/_onlogin'),
			'wiki':       wiki
		}))
示例#5
0
    def get(self):
        if self.request.host.find("appspot") != -1 and self.request.url.find(
                "https") != 0:  # if on appspot.com and not in ssl mode
            self.redirect("http://www.zen-wiki.com" + self.request.path)

        wiki = None
        user = users.get_current_user()
        if user:
            wiki = Wiki.getByUser(user)

        self.response.out.write(
            template.render(
                'templates/index.html', {
                    'user': user,
                    'logout_url': users.create_logout_url(self.request.path),
                    'login_url': users.create_login_url('/_onlogin'),
                    'wiki': wiki
                }))