~ubuntuone-pqm-team/canonical-identity-provider/trunk

« back to all changes in this revision

Viewing changes to identityprovider/context_processors.py

  • Committer: Danny Tamez
  • Date: 2010-04-21 15:29:24 UTC
  • Revision ID: danny.tamez@canonical.com-20100421152924-lq1m92tstk2iz75a
Canonical SSO Provider (Open Source) - Initial Commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2010 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""
 
5
Request processors return dictionaries to be merged into a
 
6
template context. Each function takes the request object as its only parameter
 
7
and returns a dictionary to add to the context.
 
8
 
 
9
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
 
10
RequestContext.
 
11
"""
 
12
 
 
13
from django.conf import settings
 
14
 
 
15
from identityprovider.branding import current_brand
 
16
 
 
17
 
 
18
def readonly(request):
 
19
    return {'readonly': getattr(settings, 'READ_ONLY_MODE', False)}
 
20
 
 
21
 
 
22
def branding(request):
 
23
    return {
 
24
            'template_dir': current_brand.template_dir,
 
25
            'sso_brand_name': u'%s' % current_brand.name,
 
26
            'brand': current_brand,
 
27
            }