summaryrefslogtreecommitdiff
path: root/meetingtools/utils.py
blob: eee0d803bac69d4ce1d9c0fbeee9bc2a6a337ea3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'''
Created on Feb 4, 2011

@author: leifj
'''

def session(request,key=None,val=None):
    if key:
        if val:
            request.session[key] = val
            return val
        else:
            if not request.session.has_key(key):
                request.session[key] = None
            return request.session[key]
    else:
        return request.session

def base_url(request):
    return "%s://%s/" % ({True: 'https',False:'http'}[request.is_secure()],request.get_host())