plateforme-tfjm2/tfjm/context_processors.py

16 lines
448 B
Python

from django.conf import settings
from participation.models import Tournament
def tfjm_context(request):
return {
'TFJM': {
'APP': settings.TFJM_APP,
'ML_MANAGEMENT': settings.ML_MANAGEMENT,
'PAYMENT_MANAGEMENT': settings.PAYMENT_MANAGEMENT,
'SINGLE_TOURNAMENT':
Tournament.objects.first() if Tournament.objects.exists() and settings.TFJM_APP else None,
}
}