Skip to content

Commit

Permalink
Added COLAB_APPS_LOGIN_URLS
Browse files Browse the repository at this point in the history
Signed-off-by: Matheus Fernandes <matheus.souza.fernandes@gmail.com>
Signed-off-by: Simião Carvalho <simiaosimis@gmail.com>
  • Loading branch information
msfernandes committed Mar 23, 2016
1 parent a3ac7a3 commit 4b2ff07
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions colab/accounts/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from django.conf import settings
from django.core.urlresolvers import reverse


def social_network_enabled(request):
return {'SOCIAL_NETWORK_ENABLED': getattr(settings,
'SOCIAL_NETWORK_ENABLED',
Expand Down
1 change: 1 addition & 0 deletions colab/middlewares/redirect_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.core.urlresolvers import reverse
from django.conf import settings


class RedirectLoginMiddleware(object):

def process_request(self, request):
Expand Down
5 changes: 5 additions & 0 deletions colab/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ def get_env_setting(setting):
locals().update(conf.load_py_settings())
locals().update(conf.load_colab_apps())

COLAB_APPS_LOGIN_URLS = []
COLAB_APPS = locals().get('COLAB_APPS') or {}

for app_name, app in COLAB_APPS.items():
Expand All @@ -288,6 +289,10 @@ def get_env_setting(setting):
if context_processor not in TEMPLATE_CONTEXT_PROCESSORS:
TEMPLATE_CONTEXT_PROCESSORS += (context_processor,)

plugin_urls = app.get('urls')
if 'login' in plugin_urls:
COLAB_APPS_LOGIN_URLS.append(plugin_urls.get('login'))

colab_templates = locals().get('COLAB_TEMPLATES') or ()
colab_statics = locals().get('COLAB_STATICS') or []

Expand Down

0 comments on commit 4b2ff07

Please sign in to comment.