flake8 cleanups, ununsed imports and variables cleanup, changed register_diagnostics to use reverse_lazy instead of reverse

This commit is contained in:
Roberto Rosario
2011-05-06 10:39:54 -04:00
parent c40b3eec66
commit 07e9b12e78
14 changed files with 33 additions and 40 deletions

View File

@@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.utils.functional import lazy
from django.utils.functional import lazy
diagnostics = {}
tools = {}
@@ -9,7 +9,7 @@ reverse_lazy = lazy(reverse, str)
def register_diagnostic(namespace, title, link):
namespace_dict = diagnostics.get(namespace, {'title': None, 'links': []})
namespace_dict['title'] = title
link['url'] = link.get('url', reverse(link['view']))
link['url'] = link.get('url', reverse_lazy(link['view']))
namespace_dict['links'].append(link)
diagnostics[namespace] = namespace_dict