Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2977 มุมมอง

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


อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
พ.ค. 19
15208
0
พ.ย. 17
4625
2
ธ.ค. 23
7104
0
พ.ย. 21
2752
0
ส.ค. 17
3422