(user)
return dashboard_settings
Gets dashboard settings for the user given. If no settings found, creates
    default settings.

    :param django.contrib.auth.models.User user:
    :return dash.models.DashboardSettings: Returns
        ``dash.models.DashboardSettings`` instance.
Gets dashboard settings for the user given. If no settings found, creates
    default settings.
Gets dashboard settings for the user given . If no settings found creates default settings .
def get_or_create_dashboard_settings(user):
    """
    Gets dashboard settings for the user given. If no settings found, creates
    default settings.

    :param django.contrib.auth.models.User user:
    :return dash.models.DashboardSettings: Returns
        ``dash.models.DashboardSettings`` instance.
    """
    # Check if user trying to edit the dashboard workspace actually owns it.
    try:
        dashboard_settings = DashboardSettings._default_manager \
                                              .select_related('user') \
                                              .get(user=user)
    except ObjectDoesNotExist as err:
        layout = get_layout(as_instance=True)
        dashboard_settings = DashboardSettings()
        dashboard_settings.layout_uid = layout.uid
        dashboard_settings.user = user
        dashboard_settings.save()

    return dashboard_settings
def get_or_create_dashboard_settings ( user ) : # Check if user trying to edit the dashboard workspace actually owns it. try : dashboard_settings = DashboardSettings . _default_manager . select_related ( 'user' ) . get ( user = user ) except ObjectDoesNotExist as err : layout = get_layout ( as_instance = True ) dashboard_settings = DashboardSettings ( ) dashboard_settings . layout_uid = layout . uid dashboard_settings . user = user dashboard_settings . save ( ) return dashboard_settings