This is a stylistic comment: for code readability, you may want to put the exceptional case (None) at the end, and the normal case in the beginning.  This way, we can easily see what we are assigning to in the non-exceptional case.  So it would be: 

unit = ancestor_xblocks[0] if ancestor_xblocks else None
unit_publish_state = compute_publish_state(unit) if unit else None