c3navclient? hide the headers!

This commit is contained in:
Laura Klünder 2018-11-26 00:51:17 +01:00
parent 92ce3144bf
commit 5055b6a367
6 changed files with 36 additions and 18 deletions

View file

@ -1,5 +1,8 @@
import json
import os
from django.core.serializers.json import DjangoJSONEncoder
from c3nav.site.finders import logo_paths
logos_result = {
@ -10,3 +13,15 @@ logos_result = {
def logos(request):
return logos_result
def mobileclient(request):
return {
'mobileclient': 'c3navclient' in request.META['HTTP_USER_AGENT'],
}
def user_data_json(request):
return {
'user_data_json': lambda: json.dumps(dict(request.user_data), cls=DjangoJSONEncoder),
}