1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #17892 -- Do not include whole RegexURLPattern lists in RegexURLResolver repr

Thanks milosu for the report and the initial patch.
This commit is contained in:
Claude Paroz
2012-09-01 22:07:18 +02:00
parent c6088bc91d
commit 28fd876bae
2 changed files with 17 additions and 2 deletions

View File

@@ -245,8 +245,13 @@ class RegexURLResolver(LocaleRegexProvider):
self._app_dict = {}
def __repr__(self):
if isinstance(self.urlconf_name, list) and len(self.urlconf_name):
# Don't bother to output the whole list, it can be huge
urlconf_repr = '<%s list>' % self.urlconf_name[0].__class__.__name__
else:
urlconf_repr = repr(self.urlconf_name)
return force_str('<%s %s (%s:%s) %s>' % (
self.__class__.__name__, self.urlconf_name, self.app_name,
self.__class__.__name__, urlconf_repr, self.app_name,
self.namespace, self.regex.pattern))
def _populate(self):