Fix error when accessing some pages of the admin interface

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4153 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_handler.py b/frontend/afe/rpc_handler.py
index 3cf400b..52c0adf 100644
--- a/frontend/afe/rpc_handler.py
+++ b/frontend/afe/rpc_handler.py
@@ -5,7 +5,7 @@
 
 __author__ = 'showard@google.com (Steve Howard)'
 
-import traceback, pydoc, re, urllib, logging, logging.handlers
+import traceback, pydoc, re, urllib, logging, logging.handlers, inspect
 from autotest_lib.frontend.afe.json_rpc import serviceHandler
 from autotest_lib.frontend.afe import models, rpc_utils
 from autotest_lib.client.common_lib import global_config
@@ -127,7 +127,7 @@
             if name.startswith('_'):
                 continue
             attribute = getattr(module, name)
-            if not callable(attribute):
+            if not inspect.isfunction(attribute):
                 continue
             decorated_function = RpcHandler._allow_keyword_args(attribute)
             setattr(self._rpc_methods, name, decorated_function)
diff --git a/frontend/afe/urls.py b/frontend/afe/urls.py
index c050a7b..9124a32 100644
--- a/frontend/afe/urls.py
+++ b/frontend/afe/urls.py
@@ -13,6 +13,7 @@
 # Job feeds
 debug_patterns += defaults.patterns(
         '',
+        (r'^model_doc/', 'frontend.afe.views.model_documentation'),
         (r'^feeds/(?P<url>.*)/$', 'frontend.afe.feeds.feed.feed_view',
          {'feed_dict': feeds})
     )
diff --git a/frontend/planner/views.py b/frontend/planner/views.py
index 092c56a..541e707 100644
--- a/frontend/planner/views.py
+++ b/frontend/planner/views.py
@@ -15,10 +15,3 @@
 
 def rpc_documentation(request):
     return rpc_handler_obj.get_rpc_documentation()
-
-
-def model_documentation(request):
-    model_names = ('Plan', 'Host', 'ControlFile', 'Test', 'Job', 'KeyVal',
-                   'Bug', 'TestRun', 'DataType', 'History', 'SavedObject',
-                   'CustomQuery', 'AutoProcess')
-    return views_common.model_documentation(models, model_names)
diff --git a/frontend/urls_common.py b/frontend/urls_common.py
index 2049e00..af2733b 100644
--- a/frontend/urls_common.py
+++ b/frontend/urls_common.py
@@ -19,8 +19,6 @@
         )
 
     debug_pattern_list = defaults.patterns('',
-            (r'^model_doc/', '%s.views.model_documentation' % django_name),
-
             # for GWT hosted mode
             (r'^(?P<forward_addr>autotest.*)',
              'autotest_lib.frontend.afe.views.gwt_forward'),