Improve logic in BP_Group_Documents_Template::do_post_logic