Esempio n. 1
0
    def get(self, request, *args, **kwargs):
        user = request.user
        ctx = {}
        ctx['frame_id'] = self.__class__.__frame_id

        if UserBank.objects.filter(user=user, is_rescinded=False, bank_name=u'中国农业银行').exists():
            ctx['username'] = user.username
            ctx['inst_fund_acc'] = AbSignInOutContractHomeView.get_inst_fund_acc_id(user)

            r = AbSignInContractLog.objects.filter(user=user, status=1).order_by('modified_time').last()
            if r:
                item_names = ['client_name', 'cert_id', 'fax_no', 'mobile', 'tel_no', 'postcode', 'address', 'email']
                for ele in item_names:
                    if hasattr(r, ele):
                        ctx[ele] = getattr(r, ele, '')
                ctx['bank_account'] = mask_bank_card_no(r.bank_account)
                ctx['cert_id'] = mask_id_card_no(r.cert_id)

            tpl = 'customer/finance/ab/rescind/step1.html'

        elif hasattr(user, 'userprofile') and user.userprofile.pay_pwd:
            ctx['user_name'] = user.username
            ctx['inst_fund_acc'] = self.get_inst_fund_acc_id(user)
            if user.userprofile.audit_status == 2:
                ctx['is_real_name_authed'] = True
                ctx['cert_id'] = mask_id_card_no(user.userprofile.identification_card_number)
                ctx['bank_account_name'] = user.userprofile.real_name
                ctx['cert_type'] = user.userprofile.cert_type
            tpl = 'customer/finance/ab/sign_in/ab_sign_in_contract_1.html'

        else:  # 需要先设置资金密码
            tpl = 'customer/finance/ab/sign_in/ab_sign_in_no_pwd.html'
            # return redirect('customer:safety-validate-payment-update_password')

        return render(request, tpl, ctx)
Esempio n. 2
0
    def get(self, request, *args, **kwargs):
        user = request.user
        ctx = {}
        ctx['frame_id'] = self.__class__.__frame_id

        if UserBank.objects.filter(user=user, is_rescinded=False, bank_name=u'中国农业银行').exists():
            r = AbSignInContractLog.objects.filter(user=user, status=1).order_by('modified_time').last()

            if r:
                ctx['bank_account'] = mask_bank_card_no(r.bank_account)
                ctx['client_name'] = r.client_name
            ctx['mobile'] = user.userprofile.mobile_phone
            ctx['cert_type'] = user.userprofile.cert_type
            tpl = 'customer/finance/ab/rescind/step2.html'
            return render(request, tpl, ctx)
        else:
            return redirect('customer:finance-ab-sign_in_out_home')