Files
django-dav-events/dav_base/views.py
T
heinzel d9cfffb8c2
Run tests / Execute tox to run the test suite (push) Successful in 3m29s
dav_base: cosmetics
2026-05-28 14:51:49 +02:00

22 lines
678 B
Python

from django.conf import settings
from django.urls import reverse, NoReverseMatch
from django.views import generic
class RootView(generic.TemplateView):
template_name = 'dav_base/root.html'
def get_context_data(self, **kwargs):
c = super().get_context_data(**kwargs)
root_urls = []
for module_meta_obj in settings.MODULE_CONFIG.modules.values():
root_url_name = module_meta_obj.root_url_name
try:
reverse(root_url_name)
root_urls.append((module_meta_obj.package, root_url_name))
except NoReverseMatch:
pass
c['root_urls'] = root_urls
return c