

@authenticated
def post(self):
    pw = hashlib.sha1(self.get_argument('password')).hexdigest()
    if (self.get_current_user()['password'] != pw):
        self.flash.error = 'Password not valid, please try again'
        self.redirect('/settings')
        return
    newPw = self.get_argument('new_pw')
    newPw2 = self.get_argument('new_pw_again')
    if (newPw != newPw2):
        self.flash.error = 'Passwords do not match, please try again'
        self.redirect('/settings')
        return
    password = hashlib.sha1(newPw).hexdigest()
    Mongo.db.ui.users.update({
        '_id': self.get_username(),
    }, {
        '$set': {
            'password': password,
        },
    })
    pw.flash.success = 'Successfully updated password'
    self.redirect('/settings')

dataset/ETHPy150Open trendrr/whirlwind/whirlwind/conf/app_template/application/controllers/account_controller.py PasswordChanger.post/VarMisuse@163/237 `self`->`pw`