[Django]-Get_success_url with arguments after creation

6👍

The primary key is an attribute of self.object, not self (the view itself).

def get_success_url(self):
    return reverse_lazy('accounts:detail_company', kwargs={'pk': self.object.pk})

Leave a comment