We're updating the issue view to help you get more done. 

Can't create a new user when email address is not provided

Description

When I was testing OLMIS-4935, I noticed that it's impossible to create a new user when the "Email" field is left blank, even though the field is not a required one. After clicking the "Create User" button, an Internal Server Error on the UI and in the console occurs, and the user is not created. Leaving any other not required field blank doesn't cause the error. Please look at the screenshot.

The response for the auth request in "Network":

1 2 3 4 5 6 7 8 { "timestamp" : "2018-07-03T10:20:05.249+0000", "status" : 500, "error" : "Internal Server Error", "exception" : "org.openlmis.auth.service.DataRetrievalException", "message" : "Unable to retrieve UserMainDetailsDto. Error code: 500, response message: {\n \"timestamp\" : \"2018-07-03T10:20:05.205+0000\",\n \"status\" : 500,\n \"error\" : \"Internal Server Error\",\n \"exception\" : \"org.springframework.web.client.HttpClientErrorException\",\n \"message\" : \"400 null\",\n \"path\" : \"/api/users/\"\n}", "path" : "/api/users/auth" }

Reproduction steps:

  1. Log into the application as administrator and navigate to Administration > Users.

  2. Complete only the required fields.

  3. Click the "Create User" button.

  4. The user is not created. Instead, the Internal Server Error occurs both on the UI and in the console.

Expected behavior:

  • It should be possible to create users without an email address, as this is not a required field.

Environment

None

Status

Assignee

Unassigned

Reporter

Joanna Bebak

Labels

None

Components

Priority

Critical