Skip to content

Commit

Permalink
Merge branch 'feature/shibui-1788' of bitbucket.org:unicon/shib-idp-u…
Browse files Browse the repository at this point in the history
…i into feature/shibui-1788
  • Loading branch information
rmathis committed Jun 23, 2021
2 parents bb392c2 + 43d2b18 commit eb65b70
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ public class CustomEntityAttributesDefinitionsController {
@Transactional
public ResponseEntity<?> create(@RequestBody CustomEntityAttributeDefinition definition) {
// If already defined, we can't create a new one, nor will this call update the definition
CustomEntityAttributeDefinition cad = caService.find(definition.getName());
CustomEntityAttributeDefinition cad = caService.find(definition.getResourceId());

if (cad != null) {
HttpHeaders headers = new HttpHeaders();
headers.setLocation(ServletUriComponentsBuilder.fromCurrentServletMapping().path("/api/custom/entity/attribute").build().toUri());

return ResponseEntity.status(HttpStatus.CONFLICT).headers(headers)
.body(new ErrorResponse(String.valueOf(HttpStatus.CONFLICT.value()),
String.format("The custom attribute definition with name: [%s] already exists.", definition.getName())));
String.format("The custom attribute definition already exists - unable to create a new definition")));
}

CustomEntityAttributeDefinition result = caService.createOrUpdateDefinition(definition);
Expand Down

0 comments on commit eb65b70

Please sign in to comment.