예제 #1
0
    def prepare(self):
        super(AdminBase, self).prepare()
        _login_redirect(self)

        zsite = self.zsite
        zsite_id = self.zsite_id
        current_user_id = self.current_user_id

        if not site_can_admin(zsite_id, current_user_id):
            return self.redirect('/')
예제 #2
0
    def get(self):
        zsite_id = self.zsite_id
        current_user_id = self.current_user_id

        can_admin = site_can_admin(zsite_id, current_user_id)

        if can_admin:
            return self.redirect('/admin')
        wall = wall_by_from_id_to_id(current_user_id, zsite_id)
        if wall:
            reply_last = wall.reply_last()
            if reply_last:
                self.render(reply=reply_last)

        self.render()
예제 #3
0
    def get(self):
        zsite_id = self.zsite_id
        current_user_id = self.current_user_id

        can_admin = site_can_admin(zsite_id, current_user_id)

        if can_admin:
            return self.redirect('/admin')
        wall = wall_by_from_id_to_id(current_user_id, zsite_id)
        if wall:
            reply_last = wall.reply_last()
            if reply_last:
                self.render(reply=reply_last)

        self.render()