Browse Source

Changed the url regular expression ruling method

Roland Haroutiounian 8 years ago
parent
commit
c81ae78005
2 changed files with 8 additions and 3 deletions
  1. 7
    2
      plugins/webui/interface/router.py
  2. 1
    1
      plugins/webui/interface/urls.py

+ 7
- 2
plugins/webui/interface/router.py View File

@@ -26,9 +26,14 @@ def get_controller(request):
26 26
 
27 27
     # Returning the right controller to call
28 28
     for regex, callback in url_rules:
29
-        match = re.search(regex, request.PATH)
29
+        p = re.compile(regex)
30
+        m = p.search(request.PATH)
31
+        if m is not None:
32
+            request.url_args = m.groups()
33
+            return callback
34
+        '''match = re.search(regex, request.PATH)
30 35
         if match is not None:
31 36
             request.url_args = match.groups()
32 37
             return callback
33
-
38
+        '''
34 39
     return not_found

+ 1
- 1
plugins/webui/interface/urls.py View File

@@ -6,7 +6,7 @@ urls = (
6 6
     (r'admin/(.+)$', admin),
7 7
     (r'test/(.+)$', test),
8 8
     (r'test/?$', test),
9
-    (r'show/(.+)$', show_document),
9
+    (r'show/(?P<id>.*)$', show_document),
10 10
     (r'list_classes/(.+)$', list_classes),
11 11
     (r'list_classes/?$', list_classes),
12 12
 )

Loading…
Cancel
Save