begin work on perms

This commit is contained in:
2021-10-22 16:13:08 +01:00
parent a184bbfa26
commit 280a1d9604
5 changed files with 10 additions and 7 deletions

View File

@@ -5,7 +5,6 @@ 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.
@@ -43,7 +42,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()
context["completed_levels"] = self.object.as_trainee.level_qualifications()
return context