pbs/django-cms — pull request #2 by kux (2013-03-06 14:44:28+00:00)
Title:     Fix for issue #1555 and #1620: Page path rewriting when published page becomes the HOME page

* when CMS_MODERATOR = True:
if the draft page is unpublished, the public version is also unpublished

* when determining the home page, ignore publication_date and publication_end_date this ensures that the home page path rewriting logic happens even if the page will only become available somewhere in the future

* change the post_save_page signal handler so that it also updates the:
** paths(titles) of the currently saved page
** if the currently saved page becomes the new home page, then update the paths(titles) of the previous home page
** if the currently saved page used to be the home page, then update the paths(titles) of the new home page

* add pre/post delete signal handlers that: if the currently deleted page was the home page
then update the path of the new home page

* Added unit tests for all the above functionality

This ensures that:
* we will always have AT MOST one page with the '' (empty) path

* no matter what publishing method is used (tick the publish/unpublish checkbox in the page hierarchy,
tick the 'is published' checkbox from the 'change page' view OR click 'publish' while doing frontend editing)
the generated paths are consistent