diff options
| author | Claude Paroz <claude@2xlibre.net> | 2017-04-02 20:14:39 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-06-06 18:02:22 +0200 |
| commit | 23142eea85c66bfd2cdade016054ed162ea0fa63 (patch) | |
| tree | 1db7f5e2c66d6532beba3af276b082a9ad63bb62 /django/views | |
| parent | 41e02ab368af3e64f82a568880cbc8fb0bc527f6 (diff) | |
Fixed #18394 -- Added error for invalid JavaScriptCatalog packages
Thanks Tim Graham for the review.
Diffstat (limited to 'django/views')
| -rw-r--r-- | django/views/i18n.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/django/views/i18n.py b/django/views/i18n.py index 9edf83e857..9a16a78368 100644 --- a/django/views/i18n.py +++ b/django/views/i18n.py @@ -232,6 +232,11 @@ class JavaScriptCatalog(View): def get_paths(self, packages): allowable_packages = {app_config.name: app_config for app_config in apps.get_app_configs()} app_configs = [allowable_packages[p] for p in packages if p in allowable_packages] + if len(app_configs) < len(packages): + excluded = [p for p in packages if p not in allowable_packages] + raise ValueError( + 'Invalid package(s) provided to JavaScriptCatalog: %s' % ','.join(excluded) + ) # paths of requested packages return [os.path.join(app.path, 'locale') for app in app_configs] |
