title: Django success url using kwargs
body: <p>I am trying to amend my <code>get_success_url</code> so that if any <code>kwargs</code> have been passed to it, I can build the returned url using them.</p>
  
  <p>Heres what I have so far:</p>
  
  <pre><code>class CalcUpdate(SuccessMessageMixin, UpdateView):
      model = Calc
      template_name = 'calc/cru_template.html'
      form_class = CalcForm
  
      def archive_calc(self, object_id):
          model_a = Calc.objects.get(id = object_id)
          model_b = Calc()
  
          for field in model_a._meta.fields:
              setattr(model_b, field.name, getattr(model_a, field.name))
          model_b.pk = None
          model_b.save()
  
          self.get_success_url(idnumber = model_b.pk)
  
      def form_valid(self, form):
          #objects
          if self.object.checked == True:
              object_id = self.object.id
              self.archive_calc(object_id)
          #save
  
      def get_success_url(self, **kwargs):         
          if  kwargs != None:
              return reverse_lazy('detail', kwargs = {'pk': kwargs['idnumber']})
          else:
              return reverse_lazy('detail', args = (self.object.id,))
  </code></pre>
  
  <p>So far this just gives a <code>keyerror</code> detailing <code>'idnumber'</code>.</p>
  
  <p>I have printed <code>kwargs['idnumber']</code> and it returns the <code>pk</code> as expected however I just cant seem to see where I am going wrong with this.</p>
  
  <p>Thanks in advance.</p>