+ for authority in authorities:
+ if authority['name'] == wsgi_request.POST.get('org_name', ''):
+ authority_hrn = authority['authority_hrn']
+
+ # Handle the case when the template uses only hrn and not name
+ if authority_hrn is None:
+ authority_hrn = wsgi_request.POST.get('org_name', '')
+