Source code for shuup.admin.breadcrumbs._breadcrumbs

# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals

from django.utils.translation import ugettext_lazy as _

from shuup.admin.base import MenuEntry
from shuup.admin.module_registry import get_modules
from shuup.utils.django_compat import force_text


def _get_admin_module_for_url(url_names):
    for module in get_modules():
        for url in module.get_urls():
            if url.name in url_names:
                return module