How to redirect a user to submited confrim page if he has submited a kyc from?

Viewed 40

Well here I just want to redirect a user to submitted confirm page. There is one option in sidebar for kyc form , If he ones submitted the kyc forms then whenever he clicks on kyc form he should redirect to the submitted confrim page instead of kyc create form.

How it can be done ?

class KycFormCreateView(CreateView):

model = KycModel
template_name = "accounts/kyc/new_kyc.html"

def get(self):
    userkyc  = KycModel.objects.filter(owner=self.request.model)
    print('user kyc form count ',userkyc.count())
    userkyc  = KycModel.objects.filter(owner=self.request.model)
    print('user kyc form count ',userkyc.count())
    if userkyc.count() >=1:
        return('accounts:submitted')
    else:
        form_class = KycModelForm
        return form_class

I'm trying this way and this is not making sense at all.... and getting an error: TypeError at /accounts/kyc get() takes 1 positional argument but 2 were given

0 Answers
Related