|
30 | 30 | from django.template.loader import get_template |
31 | 31 | from django.templatetags.static import StaticNode |
32 | 32 | from django.urls import reverse as urlreverse |
33 | | -from django.utils.encoding import force_text |
34 | 33 |
|
35 | 34 | import debug # pyflakes:ignore |
36 | 35 |
|
@@ -154,19 +153,23 @@ def send_complex_mail(to): |
154 | 153 | self.assertEqual(len(outbox),len_before+2) |
155 | 154 |
|
156 | 155 |
|
157 | | -def get_callbacks(urllist): |
| 156 | +def get_callbacks(urllist, namespace=None): |
158 | 157 | callbacks = set() |
| 158 | + def qualified(name): |
| 159 | + return '%s:%s' % (namespace, name) if namespace else name |
159 | 160 | for entry in urllist: |
160 | 161 | if hasattr(entry, 'url_patterns'): |
161 | | - callbacks.update(get_callbacks(entry.url_patterns)) |
| 162 | + callbacks.update(get_callbacks(entry.url_patterns, entry.namespace)) |
162 | 163 | else: |
163 | 164 | if hasattr(entry, '_callback_str'): |
164 | | - callbacks.add(force_text(entry._callback_str)) |
165 | | - if (hasattr(entry, 'callback') and entry.callback |
166 | | - and type(entry.callback) in [types.FunctionType, types.MethodType ]): |
167 | | - callbacks.add("%s.%s" % (entry.callback.__module__, entry.callback.__name__)) |
| 165 | + callbacks.add(qualified(entry._callback_str)) |
| 166 | + if (hasattr(entry, 'callback') and entry.callback and |
| 167 | + type(entry.callback) in [types.FunctionType, types.MethodType ]): |
| 168 | + callbacks.add(qualified("%s.%s" % (entry.callback.__module__, entry.callback.__name__))) |
168 | 169 | if hasattr(entry, 'name') and entry.name: |
169 | | - callbacks.add(force_text(entry.name)) |
| 170 | + callbacks.add(qualified(entry.name)) |
| 171 | + if hasattr(entry, 'lookup_str') and entry.lookup_str: |
| 172 | + callbacks.add(qualified(entry.lookup_str)) |
170 | 173 | # There are some entries we don't handle here, mostly clases |
171 | 174 | # (such as Feed subclasses) |
172 | 175 |
|
|
0 commit comments