get_success_url() takes exactly 3 arguments (2 given)

后端 未结 3 859
执念已碎
执念已碎 2021-01-28 05:58

every one ,, I am using

django-registration-redux (1.4)

for my django registration(django 1.8),,however ,,when never I registered th

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-28 06:35

    In django-registration-redux RegistrationView has get_success_url defined as this.

    def get_success_url(self, user=None):
        """
        Use the new user when constructing success_url.
        """
        return super(RegistrationView, self).get_success_url()
    

    Thus it seems that only two parameters will be passed to that funciton. Yet in your subclass of if you have

    def get_success_url(self, request, user):
       # the named URL that we want to redirect to after # successful    registration
        return ('home') 
    

    Which has an extra request parameter which you are not going to recieve. hence the error.

提交回复
热议问题