if authorities is not None:
# Remove the root authority from the list
matching = [s for s in authorities if "." in s['authority_hrn']]
authorities = sorted(matching, key=lambda k: k['authority_hrn'])
authorities = sorted(matching, key=lambda k: k['name'])
if authorities is not None:
# Remove the root authority from the list
matching = [s for s in authorities if "." in s['authority_hrn']]
authorities = sorted(matching, key=lambda k: k['authority_hrn'])
authorities = sorted(matching, key=lambda k: k['name'])