GSA-TTS / FAC

GSA's Federal Audit Clearinghouse
Other
18 stars 5 forks source link

FAC - Bug: General Information Schema Validation Errors Do Not Display #3970

Closed jperson1 closed 3 days ago

jperson1 commented 3 weeks ago

Describe the bug

When the general information form is submitted, it passes through two layers of validation. The first is with the Django form object, and related errors are passed back to the user properly. The second is schema validation. If the schema check fails, it will reload the form for the user with the wrong data.

  1. Errors are passed in Django context, but are not displayed to the user. So, we just get a "Hey there are errors" with no further information.
  2. The date will be improperly formatted. We convert them before running the schema validation, and don't convert back before displaying to the user.

With issues 1 and 2 combined, we've had a few cases where the error appears to be the date field, which is frustrating for users. See this ZenDesk ticket: https://fac-gov.zendesk.com/agent/tickets/3749, issue https://github.com/GSA-TTS/FAC/issues/3969

Steps to reproduce the bug

  1. Navigate to the general information form
  2. Enter anything that would cause a schema error, but not a form error. Such as: i. Select Audit period -> Other ii. Enter a single digit audit period, such as 7
  3. Verify that an error occurs, and the form comes back with: a. No/wrong inputted information b. Incorrectly formatted dates

Expected Behavior

  1. Navigate to the general information form
  2. Enter anything that would cause a schema error, but not a form error. Such as: i. Select Audit period -> Other ii. Enter a single digit audit period, such as 7
  3. An error should still occur, but it should be displayed to the user. Ideally at the field where the error happened, or at the top of the page below the "There are errors" message.
  4. The dates should be correct. So, they should be converted back to MM/DD/YYYY or pulled from earlier before displaying them to the user.

Screenshots

The generic error message displays with no specifics, and the dates are formatted incorrectly. So, users may believe the dates are the problem.

image

System setup

No response

Additional context

No response

Code of Conduct