Move diagnostics, statistics and maintenance functions from the main app into separate apps
This commit is contained in:
11
apps/diagnostics/api.py
Normal file
11
apps/diagnostics/api.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from common.utils import reverse_lazy
|
||||
|
||||
diagnostics = {}
|
||||
|
||||
|
||||
def register_diagnostic(namespace, title, link):
|
||||
namespace_dict = diagnostics.get(namespace, {'title': None, 'links': []})
|
||||
namespace_dict['title'] = title
|
||||
link.url = getattr(link, 'url', reverse_lazy(link.view))
|
||||
namespace_dict['links'].append(link)
|
||||
diagnostics[namespace] = namespace_dict
|
||||
Reference in New Issue
Block a user