class ProjectDetailsController {

    @PreAuthorize("hasPermission(#projectId, 'org.innovateuk.ifs.project.resource.ProjectCompositeId', 'ACCESS_PARTNER_PROJECT_LOCATION_PAGE')")
    @PostMapping("/{projectId}/organisation/{organisationId}/partner-project-location")
    public String updatePartnerProjectLocation(@PathVariable("projectId") final long projectId,
                                               @PathVariable("organisationId") final long organisationId,
                                               @ModelAttribute(FORM_ATTR_NAME) PartnerProjectLocationForm form,
                                               @SuppressWarnings("unused") BindingResult bindingResult, ValidationHandler validationHandler,
                                               Model model,
                                               UserResource loggedInUser) {

        OrganisationResource organisation = organisationRestService.getOrganisationById(organisationId).getSuccess();

        Supplier<String> failureView = () -> doViewPartnerProjectLocation(projectId, organisation, loggedInUser, model, form);

        return validationHandler.failNowOrSucceedWith(failureView, () -> {
            PostcodeAndTownResource postcodeAndTownResource = new PostcodeAndTownResource(form.getPostcode(), form.getTown());
            ServiceResult<Void> updateResult = projectDetailsService.updatePartnerProjectLocation(projectId, organisationId, postcodeAndTownResource);

            return validationHandler.addAnyErrors(updateResult, errorConverter(organisation)).
                    failNowOrSucceedWith(failureView, () -> redirectToProjectDetails(projectId));
        });
    }

}