fix base template loading

This commit is contained in:
Serghei Mihai 2015-05-25 16:54:05 +02:00
parent f704453da8
commit dae66475ba
1 changed files with 3 additions and 1 deletions

View File

@ -4,11 +4,13 @@ from django.conf import settings
from django.template.loader import get_template, TemplateDoesNotExist
def theme_base(request):
base = get_template('uauth/base.html')
if request.session.get('organization'):
try:
base = get_template('base.html', [os.path.join(settings.ORGANIZATIONS_DIR,
request.session['organization'], 'templates')])
except TemplateDoesNotExist:
base = get_template('uauth/base.html')
pass
return {'theme_base': base}