Skip to content

Only set User#notification_email with user input

What does this MR do?

Previously the User "notification preferences" form automatically set a value for User#notification_email. This would become the database value when the user submitted the form, whether the user was aware of this or not. That behavior recently became unnecessary, because the User model now assumes the notification_email is the primary email when not set. Also, that behavior was bad practice because the app should not be creating user input values without the user's knowledge. As a simple solution, this change introduces a blank option to the select dropdown, which is used by default. Now the database value will only change if the user changes it.

We are doing the same thing for User#commit_email in !68591 (merged). This is all part of a broader refactoring of User secondary emails.

Screenshots or Screencasts (strongly suggested)

Screen_Shot_2021-08-20_at_3.50.06_PM

Does this MR meet the acceptance criteria?

Conformity

Related to https://gitlab.com/groups/gitlab-org/-/epics/6564

Edited by Dan Jensen

Merge request reports