Commit 4f90b2ff authored by Martin Lowe's avatar Martin Lowe 🇨🇦
Browse files

Add check for length of org description update to fail early w/ 400

parent 619677f7
...@@ -153,6 +153,9 @@ public class OrganizationResource extends AbstractRESTResource { ...@@ -153,6 +153,9 @@ public class OrganizationResource extends AbstractRESTResource {
@RolesAllowed({ CR, DE, CRA, MA }) @RolesAllowed({ CR, DE, CRA, MA })
@Path("{orgID:\\d+}") @Path("{orgID:\\d+}")
public Response update(@PathParam("orgID") String organizationID, OrganizationInfoUpdateRequest updateRequest) { public Response update(@PathParam("orgID") String organizationID, OrganizationInfoUpdateRequest updateRequest) {
if (updateRequest.getDescription().length() > 700) {
return new org.eclipsefoundation.core.model.Error(400, "Organization description should not be over 700 characters").asResponse();
}
// get ref and update the object // get ref and update the object
OrganizationInformation infoRef = eclipseDBDao.getReference(Integer.valueOf(organizationID), OrganizationInformation infoRef = eclipseDBDao.getReference(Integer.valueOf(organizationID),
OrganizationInformation.class); OrganizationInformation.class);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment