def METHOD_NAME(self, session, message='', **params):
    if 'id' in params:
        promo_code = session.promo_code(params)
        message = check(promo_code)
        if message:
            session.rollback()
        else:
            if 'expire' in params:
                promo_code.expiration_date = localized_now() - timedelta(days=1)
            message = 'Promo code updated'
            session.commit()
        raise HTTPRedirect('index?message={}', message)