This works event without the extra query in the if statement <code>group.globalpagepermission_set.exists()</code>