def delete_course_update(location, update, passed_id, user):
 if (not passed_id):
  return HttpResponseBadRequest()
 try:
  course_updates = modulestore().get_item(location)
 except ItemNotFoundError:
  return HttpResponseBadRequest()
 course_update_items = list(reversed(get_course_update_items(course_updates)))
 passed_index = _get_index(passed_id)
 if (0 < passed_index <= len(course_update_items)):
  course_update_item = course_update_items[(passed_index - 1)]
  course_update_item['status'] = CourseInfoModule.STATUS_DELETED
  course_update_items[(passed_index - 1)] = course_update_item
  save_course_update_items(location, course_updates, course_update_items, user)
  return _get_visible_update(course_update_items)
 else:
  return HttpResponseBadRequest(_('Invalid course update id.'))

def delete_course_update ( location , update , passed_id , user ) : if ( not passed_id ) : return HttpResponseBadRequest ( ) try : course_updates = modulestore ( ) . get_item ( location ) except ItemNotFoundError : return HttpResponseBadRequest ( ) course_update_items = list ( reversed ( get_course_update_items ( course_updates ) ) ) passed_index = _get_index ( passed_id ) if ( 0 < passed_index <= len ( course_update_items ) ) : course_update_item = course_update_items [ ( passed_index - 1 ) ] course_update_item [ 'status' ] = CourseInfoModule . STATUS_DELETED course_update_items [ ( passed_index - 1 ) ] = course_update_item save_course_update_items ( location , course_updates , course_update_items , user ) return _get_visible_update ( course_update_items ) else : return HttpResponseBadRequest ( _ ( 'Invalid course update id.' ) )
dont delete course update item from db .