2021-11-22 22:19:06 +01:00
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
|
2021-03-31 21:30:51 +02:00
|
|
|
def april(req):
|
|
|
|
if 'X-April' in req.headers:
|
|
|
|
try:
|
|
|
|
year = int(req.headers['X-April'])
|
|
|
|
return {'april': year}
|
|
|
|
except:
|
|
|
|
pass # Fall-back to regular behaviour
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
today = datetime.date.today()
|
|
|
|
if today.day == 1 and today.month == 4:
|
|
|
|
return {'april': today.year}
|
|
|
|
return {}
|
|
|
|
|
2021-11-22 22:19:06 +01:00
|
|
|
|
|
|
|
def rozliseni(request):
|
2021-11-23 00:12:49 +01:00
|
|
|
ltp = settings.LOCAL_TEST_PROD
|
|
|
|
if request.user.is_superuser and ltp == "prod":
|
|
|
|
ltp = "su" + ltp
|
|
|
|
return {"LOCAL_TEST_PROD": ltp}
|
2021-11-22 22:19:06 +01:00
|
|
|
|