gestioCOF/kfet/context_processors.py
2017-02-11 00:29:12 +01:00

25 lines
620 B
Python

# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
from django.contrib.auth.context_processors import PermWrapper
from .views import KFET_OPEN
def auth(request):
if hasattr(request, 'real_user'):
return {
'user': request.real_user,
'perms': PermWrapper(request.real_user),
}
return {}
def kfet_open(resquest):
(kfet_open, kfet_open_date) = KFET_OPEN()
return {
'kfet_open': kfet_open,
'kfet_open_date': kfet_open_date,
}