示例#1
0
def get_context():
    if permissions.has_admin_permissions():
        projects = projects_service.open_projects()
    else:
        projects = get_open_projects()

    asset_types = assets_service.get_asset_types()
    custom_actions = custom_actions_service.get_custom_actions()
    status_automations = status_automations_service.get_status_automations()
    persons = persons_service.get_persons(
        minimal=not permissions.has_manager_permissions()
    )
    notification_count = get_unread_notifications_count()
    project_status_list = projects_service.get_project_statuses()
    departments = tasks_service.get_departments()
    task_types = tasks_service.get_task_types()
    task_status_list = tasks_service.get_task_statuses()
    search_filters = get_filters()

    return {
        "asset_types": asset_types,
        "custom_actions": custom_actions,
        "status_automations": status_automations,
        "departments": departments,
        "notification_count": notification_count,
        "persons": persons,
        "project_status": project_status_list,
        "projects": projects,
        "task_types": task_types,
        "task_status": task_status_list,
        "search_filters": search_filters,
    }
示例#2
0
def get_context():
    if permissions.has_admin_permissions():
        projects = projects_service.open_projects()
    else:
        projects = get_open_projects()

    asset_types = assets_service.get_asset_types()
    custom_actions = custom_actions_service.get_custom_actions()
    persons = persons_service.get_persons()
    notifications = get_last_notifications()
    project_status_list = projects_service.get_project_statuses()
    task_types = tasks_service.get_task_types()
    task_status_list = tasks_service.get_task_statuses()
    search_filters = get_filters()

    return {
        "asset_types": asset_types,
        "custom_actions": custom_actions,
        "notifications": notifications,
        "persons": persons,
        "project_status": project_status_list,
        "projects": projects,
        "task_types": task_types,
        "task_status": task_status_list,
        "search_filters": search_filters,
    }