
from ...services.brand import service as brand_service
from ...util.framework.blueprint import create_blueprint

from ..authorization.registry import permission_registry

from .authorization import AdminPermission


blueprint = create_blueprint('core_admin', __name__)


permission_registry.register_enum(AdminPermission)


@blueprint.app_context_processor
def inject_brands():
    brands = brand_service.get_brands()

    return {
        'all_brands': brands,
    }


from ...services.brand import service as brand_service
from ...util.framework.blueprint import create_blueprint

from ..authorization.registry import permission_registry

from .authorization import AdminPermission


blueprint = create_blueprint('core_admin', __name__)


permission_registry.register_enum(AdminPermission)


@blueprint.app_context_processor
def inject_template_variables():
    brands = brand_service.get_brands()

    return {
        'all_brands': brands,
    }

Generalize name of function to inject admin template variables
Generalize name of function to inject admin template variables

  
  from ...services.brand import service as brand_service
  from ...util.framework.blueprint import create_blueprint
  
  from ..authorization.registry import permission_registry
  
  from .authorization import AdminPermission
  
  
  blueprint = create_blueprint('core_admin', __name__)
  
  
  permission_registry.register_enum(AdminPermission)
  
  
  @blueprint.app_context_processor
- def inject_brands():
+ def inject_template_variables():
      brands = brand_service.get_brands()
  
      return {
          'all_brands': brands,
      }
  
Generalize name of function to inject admin template variables
## Code Before:

from ...services.brand import service as brand_service
from ...util.framework.blueprint import create_blueprint

from ..authorization.registry import permission_registry

from .authorization import AdminPermission


blueprint = create_blueprint('core_admin', __name__)


permission_registry.register_enum(AdminPermission)


@blueprint.app_context_processor
def inject_brands():
    brands = brand_service.get_brands()

    return {
        'all_brands': brands,
    }

## Instruction:
Generalize name of function to inject admin template variables
## Code After:

from ...services.brand import service as brand_service
from ...util.framework.blueprint import create_blueprint

from ..authorization.registry import permission_registry

from .authorization import AdminPermission


blueprint = create_blueprint('core_admin', __name__)


permission_registry.register_enum(AdminPermission)


@blueprint.app_context_processor
def inject_template_variables():
    brands = brand_service.get_brands()

    return {
        'all_brands': brands,
    }
