Example #1
0
 def get(self):
     if users.is_current_user_admin():
         userp = int(self.request.get('user_name'))
         userdb = UsersDB.get_by_id(userp)
         userdb.blok = False
         blokdb = BlokUserDB.gql("WHERE user = '******'" % userdb.user)
         blokdb = blokdb.get()
         blokdb.delete()
         userdb.put()
     self.redirect('/userslist')
Example #2
0
    def post(self):
        if users.is_current_user_admin():
            cadmin = users.get_current_user().nickname()
            userp = int(self.request.get('user_name'))
            text = self.request.get('text')
            userdb = UsersDB.get_by_id(userp)
            if userdb.user == users.get_current_user:
                self.redirect('/userslist')
            else:
                userdb.blok = True

                blokdb = BlokUserDB()
                blokdb.user = userdb.user
                blokdb.text = text
                blokdb.admin = cadmin

                blokdb.put()
                userdb.put()
        self.redirect('/userslist')