def pre_delete_title(instance, **kwargs):
 page = instance.page
 page_languages = page.get_languages()
 if (instance.language in page_languages):
  page_languages.remove(instance.language)
  page.update_languages(page_languages)
 if instance.publisher_is_draft:
  instance.page.mark_descendants_pending(instance.language)

def pre_delete_title ( instance , ** kwargs ) : page = instance . page page_languages = page . get_languages ( ) if ( instance . language in page_languages ) : page_languages . remove ( instance . language ) page . update_languages ( page_languages ) if instance . publisher_is_draft : instance . page . mark_descendants_pending ( instance . language )
save old state to instance and setup path .