(request, entry_id)
Remove dashboard entry.

    :param django.http.HttpRequest request:
    :param int entry_id: ID of the dashboard entry to delete.
    :return django.http.HttpResponse:
Remove dashboard entry.
Remove dashboard entry .
def delete_dashboard_entry(request, entry_id):
    """Remove dashboard entry.

    :param django.http.HttpRequest request:
    :param int entry_id: ID of the dashboard entry to delete.
    :return django.http.HttpResponse:
    """
    try:
        obj = DashboardEntry._default_manager.select_related(
            'workspace'
        ).get(
            pk=entry_id,
            user=request.user
        )
        plugin = obj.get_plugin()
        plugin.request = request
        plugin._delete_plugin_data()
        workspace = getattr(obj.workspace, 'slug', None)
        obj.delete()

        if not request.is_ajax():
            messages.info(request, _('The dashboard widget "{0}" was deleted '
                                     'successfully.').format(plugin.name))

        if request.is_ajax():
            return HttpResponse(json.dumps({'success': 1}))
        else:
            # Redirect to dashboard view.
            if workspace:
                return redirect('dash.edit_dashboard', workspace=workspace)
            else:
                return redirect('dash.edit_dashboard')
    except ObjectDoesNotExist as err:
        if request.is_ajax():
            return HttpResponse(json.dumps({'success': 1}))
        raise Http404(err)
def delete_dashboard_entry ( request , entry_id ) : try : obj = DashboardEntry . _default_manager . select_related ( 'workspace' ) . get ( pk = entry_id , user = request . user ) plugin = obj . get_plugin ( ) plugin . request = request plugin . _delete_plugin_data ( ) workspace = getattr ( obj . workspace , 'slug' , None ) obj . delete ( ) if not request . is_ajax ( ) : messages . info ( request , _ ( 'The dashboard widget "{0}" was deleted ' 'successfully.' ) . format ( plugin . name ) ) if request . is_ajax ( ) : return HttpResponse ( json . dumps ( { 'success' : 1 } ) ) else : # Redirect to dashboard view. if workspace : return redirect ( 'dash.edit_dashboard' , workspace = workspace ) else : return redirect ( 'dash.edit_dashboard' ) except ObjectDoesNotExist as err : if request . is_ajax ( ) : return HttpResponse ( json . dumps ( { 'success' : 1 } ) ) raise Http404 ( err )