Browse Source

[core] Add desktop libs with is_url_namespaced setting to global namespace

Jenny Kim 10 năm trước cách đây
mục cha
commit
e5c7a54f99

+ 4 - 8
desktop/core/src/desktop/urls.py

@@ -132,20 +132,16 @@ if settings.OPENID_AUTHENTICATION:
 if settings.OAUTH_AUTHENTICATION:
   static_patterns.append((r'^oauth/', include('liboauth.urls')))
 
-# Add indexer app
-if 'search' in [app.name for app in appmanager.DESKTOP_APPS]:
-  namespace = {'namespace': 'indexer', 'app_name': 'indexer'}
-  dynamic_patterns.extend( patterns('', ('^indexer/', include('indexer.urls', **namespace))) )
-
 # Root each app at /appname if they have a "urls" module
-for app in appmanager.DESKTOP_APPS:
+for app in appmanager.DESKTOP_MODULES:
   if app.urls:
     if app.is_url_namespaced:
       namespace = {'namespace': app.name, 'app_name': app.name}
     else:
       namespace = {}
-    dynamic_patterns.extend( patterns('', ('^' + re.escape(app.name) + '/', include(app.urls, **namespace))) )
-    app.urls_imported = True
+    if namespace or app in appmanager.DESKTOP_APPS:
+      dynamic_patterns.extend( patterns('', ('^' + re.escape(app.name) + '/', include(app.urls, **namespace))) )
+      app.urls_imported = True
 
 static_patterns.append(
     (r'^%s(?P<path>.*)$' % re.escape(settings.STATIC_URL.lstrip('/')),

+ 0 - 16
desktop/libs/librdbms/src/librdbms/urls.py

@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-# Licensed to Cloudera, Inc. under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  Cloudera, Inc. licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.