Commit 5ceb42cd authored by Daniel W Bond's avatar Daniel W Bond

created mixin to add 'student' to get_context_data

parent 019961c3
from django.shortcuts import render
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.views.generic.base import ContextMixin
# Create your views here.
class StudentContextMixin(ContextMixin):
def get_context_data(self, **kwargs):
context = super(StudentContextMixin, self).get_context_data(**kwargs)
me = self.request.user.student
context['student'] = me
return context
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment