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
colab/proxy/templatetags/proxy.py
colab/settings.py
... | ... | @@ -292,11 +292,6 @@ if locals().get('RAVEN_DSN', False): |
292 | 292 | BROWSERID_ENABLED = locals().get('BROWSERID_ENABLED') or False |
293 | 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 | 295 | COLAB_APPS = locals().get('COLAB_APPS') or {} |
301 | 296 | |
302 | 297 | for app_name, app in COLAB_APPS.items(): |
... | ... | @@ -328,6 +323,21 @@ for app_name, app in COLAB_APPS.items(): |
328 | 323 | import sys |
329 | 324 | sys.path.insert(0, '/etc/colab/') |
330 | 325 | try: |
331 | - from plugin_configs import * | |
326 | + from plugin_configs import * # noqa (flake8 ignore) | |
332 | 327 | except ImportError: |
333 | 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] | ... | ... |