mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
FIX #486: Make training item edit work
This commit is contained in:
@@ -136,15 +136,9 @@ class EditQualification(generic.UpdateView):
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super().get_context_data(**kwargs)
|
||||
context["depths"] = models.TrainingItemQualification.CHOICES
|
||||
trainee = models.Trainee.objects.get(pk=self.kwargs['pk'])
|
||||
context['page_title'] = f"Edit Qualification {self.object} for {trainee}"
|
||||
context['page_title'] = f"Edit Qualification <em>{self.object}</em> for {self.object.trainee}"
|
||||
return context
|
||||
|
||||
def get_form_kwargs(self):
|
||||
kwargs = super().get_form_kwargs()
|
||||
kwargs['pk'] = self.kwargs['pk']
|
||||
return kwargs
|
||||
|
||||
@transaction.atomic()
|
||||
@reversion.create_revision()
|
||||
def form_valid(self, form, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user