@handle_response_format
@treeio_login_required
def dashboard_widget_delete(request, widget_id, response_format='html'):
 widget = get_object_or_404(Widget, pk=widget_id)
 if (widget.user == request.user.profile):
  widget.delete()
 return HttpResponseRedirect(reverse('core_dashboard_index'))

@ handle_response_format @ treeio_login_required def dashboard_widget_delete ( request , widget_id , response_format = 'html' ) : widget = get_object_or_404 ( Widget , pk = widget_id ) if ( widget . user == request . user . profile ) : widget . delete ( ) return HttpResponseRedirect ( reverse ( 'core_dashboard_index' ) )
delete an existing widget from the dashboard .