Much template wrangling

This commit is contained in:
2021-10-22 15:57:20 +01:00
parent 4416e5bfcb
commit a184bbfa26
10 changed files with 71 additions and 49 deletions

View File

@@ -5,6 +5,7 @@ from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from RIGS import models
from training.models import Trainee
# This view should be exempt from requiring CSRF token.
@@ -42,6 +43,7 @@ class ProfileDetail(generic.DetailView):
def get_context_data(self, **kwargs):
context = super(ProfileDetail, self).get_context_data(**kwargs)
context['page_title'] = "Profile: {}".format(self.object)
context["completed_levels"] = Trainee.objects.get(pk=self.object.pk).level_qualifications()
return context