コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
2959 ビュー

Hello, I have set up a modal with a form to force the user to connect before validating the order, but my problem is that if he is wrong about his credentials the page updates and does not return any error. Below is my code


My controller


class RequireLogin(Home):       
     @http.route('/web/login_custum', type='http', auth="none")   
     def web_login_custum(self, redirect=None, **kw):       
         main.ensure_db()       
         if request.httprequest.method == 'POST':
            old_uid = request.uid
            _logger.info(":::::======>%s<======::::::"%(request.session))
            uid = request.session.authenticate(request.session.db, request.params['login'], request.params['password'])
            if uid is not False:
                 request.params['login_success'] = True
                 if not redirect:
                     redirect = '/shop/payment'
                     return http.redirect_with_hash(redirect)
            else:
                request.uid = old_uid
                kw['error'] = _("Wrong login/password")
                return http.redirect_with_hash('/shop/payment', kw)


アバター
破棄
最善の回答

Can you show your View file i wants to make a modal


アバター
破棄
著作者 最善の回答

アバター
破棄
関連投稿 返信 ビュー 活動
3
5月 19
15193
0
11月 17
4614
2
12月 23
7092
0
11月 21
2729
0
8月 17
3420