Commit f50baa5b292fd10ad9835b058bfa34a3abdce286
1 parent
1520d46a
Exists in
master
and in
34 other branches
Remove PROXIED_APPS from config file
Signed-off-by: Gustavo Jaruga <darksshades@gmail.com> Signed-off-by: Carolina Ramalho <carol15022@hotmail.com> Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Showing
4 changed files
with
16 additions
and
9 deletions
Show diff stats
colab/proxy/context_processors.py
colab/proxy/gitlab/urls.py
@@ -3,7 +3,6 @@ from django.conf.urls import patterns, url | @@ -3,7 +3,6 @@ from django.conf.urls import patterns, url | ||
3 | 3 | ||
4 | from .views import GitlabProxyView | 4 | from .views import GitlabProxyView |
5 | 5 | ||
6 | - | ||
7 | urlpatterns = patterns('', | 6 | urlpatterns = patterns('', |
8 | # Gitlab URLs | 7 | # Gitlab URLs |
9 | url(r'^(?P<path>.*)$', GitlabProxyView.as_view(), name='gitlab'), | 8 | url(r'^(?P<path>.*)$', GitlabProxyView.as_view(), name='gitlab'), |
colab/proxy/templatetags/proxy.py
1 | from collections import OrderedDict | 1 | from collections import OrderedDict |
2 | 2 | ||
3 | -from django.core.urlresolvers import reverse | ||
4 | from django import template | 3 | from django import template |
5 | from django.core.cache import cache | 4 | from django.core.cache import cache |
6 | from django.template.loader import render_to_string | 5 | from django.template.loader import render_to_string |
colab/settings.py
@@ -292,11 +292,6 @@ if locals().get('RAVEN_DSN', False): | @@ -292,11 +292,6 @@ if locals().get('RAVEN_DSN', False): | ||
292 | BROWSERID_ENABLED = locals().get('BROWSERID_ENABLED') or False | 292 | BROWSERID_ENABLED = locals().get('BROWSERID_ENABLED') or False |
293 | SOCIAL_NETWORK_ENABLED = locals().get('SOCIAL_NETWORK_ENABLED') or False | 293 | SOCIAL_NETWORK_ENABLED = locals().get('SOCIAL_NETWORK_ENABLED') or False |
294 | 294 | ||
295 | -PROXIED_APPS = locals().get('PROXIED_APPS') or {} | ||
296 | - | ||
297 | -for app_label in PROXIED_APPS.keys(): | ||
298 | - INSTALLED_APPS += ('colab.proxy.{}'.format(app_label),) | ||
299 | - | ||
300 | COLAB_APPS = locals().get('COLAB_APPS') or {} | 295 | COLAB_APPS = locals().get('COLAB_APPS') or {} |
301 | 296 | ||
302 | for app_name, app in COLAB_APPS.items(): | 297 | for app_name, app in COLAB_APPS.items(): |
@@ -328,6 +323,21 @@ for app_name, app in COLAB_APPS.items(): | @@ -328,6 +323,21 @@ for app_name, app in COLAB_APPS.items(): | ||
328 | import sys | 323 | import sys |
329 | sys.path.insert(0, '/etc/colab/') | 324 | sys.path.insert(0, '/etc/colab/') |
330 | try: | 325 | try: |
331 | - from plugin_configs import * | 326 | + from plugin_configs import * # noqa (flake8 ignore) |
332 | except ImportError: | 327 | except ImportError: |
333 | pass | 328 | pass |
329 | + | ||
330 | +from django.apps import apps | ||
331 | +import django | ||
332 | +django.setup() | ||
333 | + | ||
334 | +PROXIED_APPS = {} | ||
335 | + | ||
336 | +for app_name in COLAB_APPS: | ||
337 | + try: | ||
338 | + config = apps.get_app_config(app_name.split('.')[-1]) | ||
339 | + except: | ||
340 | + config = None | ||
341 | + | ||
342 | + if config and getattr(config, 'colab_proxied_app', False): | ||
343 | + PROXIED_APPS[app_name.split('.')[-1]] = COLAB_APPS[app_name] |