Commit d877c831e320ffc6d6fce31b97b86ab9843ad5a1
Committed by
Lucas Kanashiro
1 parent
85cc285d
Exists in
master
and in
28 other branches
Fix app_label in COLAB_APPS
Showing
3 changed files
with
6 additions
and
8 deletions
Show diff stats
colab/search/utils.py
| @@ -57,10 +57,8 @@ def get_collaboration_data(logged_user, filter_by_user=None): | @@ -57,10 +57,8 @@ def get_collaboration_data(logged_user, filter_by_user=None): | ||
| 57 | 57 | ||
| 58 | latest_results.extend(messages) | 58 | latest_results.extend(messages) |
| 59 | 59 | ||
| 60 | - app_names = settings.COLAB_APPS.keys() | ||
| 61 | - | ||
| 62 | - for app_name in app_names: | ||
| 63 | - module = importlib.import_module('{}.models'.format(app_name)) | 60 | + for app in settings.COLAB_APPS.values(): |
| 61 | + module = importlib.import_module('{}.models'.format(app.get('name'))) | ||
| 64 | 62 | ||
| 65 | for module_item_name in dir(module): | 63 | for module_item_name in dir(module): |
| 66 | module_item = getattr(module, module_item_name) | 64 | module_item = getattr(module, module_item_name) |
colab/settings.py
| @@ -266,8 +266,8 @@ for app_name, app in COLAB_APPS.items(): | @@ -266,8 +266,8 @@ for app_name, app in COLAB_APPS.items(): | ||
| 266 | if dep not in INSTALLED_APPS: | 266 | if dep not in INSTALLED_APPS: |
| 267 | INSTALLED_APPS += (dep,) | 267 | INSTALLED_APPS += (dep,) |
| 268 | 268 | ||
| 269 | - if app_name not in INSTALLED_APPS: | ||
| 270 | - INSTALLED_APPS += (app_name,) | 269 | + if app.get('name') not in INSTALLED_APPS: |
| 270 | + INSTALLED_APPS += (app.get('name'),) | ||
| 271 | 271 | ||
| 272 | if 'middlewares' in app: | 272 | if 'middlewares' in app: |
| 273 | for middleware in app.get('middlewares'): | 273 | for middleware in app.get('middlewares'): |
colab/utils/conf.py
| @@ -104,7 +104,7 @@ def load_colab_apps(): | @@ -104,7 +104,7 @@ def load_colab_apps(): | ||
| 104 | app_name = file_name | 104 | app_name = file_name |
| 105 | 105 | ||
| 106 | elif file_name.endswith('.py'): | 106 | elif file_name.endswith('.py'): |
| 107 | - app_name = py_settings_d.get('name') | 107 | + app_name = py_settings_d.get('name').split('.')[-1] |
| 108 | 108 | ||
| 109 | if not app_name: | 109 | if not app_name: |
| 110 | logger.warning("Plugin missing name variable (%s)", file_name) | 110 | logger.warning("Plugin missing name variable (%s)", file_name) |
| @@ -121,7 +121,7 @@ def load_colab_apps(): | @@ -121,7 +121,7 @@ def load_colab_apps(): | ||
| 121 | 121 | ||
| 122 | fields = ['verbose_name', 'upstream', 'urls', | 122 | fields = ['verbose_name', 'upstream', 'urls', |
| 123 | 'menu_urls', 'middlewares', 'dependencies', | 123 | 'menu_urls', 'middlewares', 'dependencies', |
| 124 | - 'context_processors', 'private_token'] | 124 | + 'context_processors', 'private_token', 'name'] |
| 125 | 125 | ||
| 126 | for key in fields: | 126 | for key in fields: |
| 127 | value = py_settings_d.get(key) | 127 | value = py_settings_d.get(key) |