ocadotechnology / codeforlife-portal

The portal code for Code for Life
https://www.codeforlife.education/
Other
51 stars 79 forks source link

Account form is broken #2377

Closed faucomte97 closed 1 week ago

faucomte97 commented 3 weeks ago

Describe the bug The edit account details form, both for Teacher and Independent Student, is broken. Since 01/11/2024, for no apparent reason, the form has stopped processing data properly.

The form allows the user to do 3 things:

In each case, the user needs to input their current password to submit the password. The name field is pre-populated, and every other field is optional.

However, now, the form acts like the new password field is required. Because of that, the user can't just update their name or email address without changing password, which is not the intended behaviour.

To Reproduce Steps to reproduce the behaviour:

  1. Log in as a teacher or an independent student.
  2. Go to the update account details form.
  3. Change the value of the name field in the form.
  4. Input your password in the "current password" field.
  5. Click the submit button.
  6. Notice that the form complains that the new password field does not meet the password criteria, despite the field being optional.

This means the form submitted the new password field as an empty string instead of ignoring it.

Expected behaviour The form should only check the fields that have been filled in.

Screenshots Screenshot from 2024-11-02 02-47-19

Desktop (please complete the following information): All

Good Places to Start Independent Student Edit Account Form Independent Student Edit Account View Independent Student Edit Account Template

Teacher Edit Account Form Teacher Edit Account View Teacher Edit Account Template

Additional context This is causing some of our existing tests to fail.

faucomte97 commented 2 weeks ago

LGTM

lauracumming commented 2 weeks ago

LGTM

lauracumming commented 1 week ago

LGTM (PROD)

faucomte97 commented 1 week ago

LGTM