Skip to content

Make notification_email like commit_email

What does this MR do?

When there is no database value for User#commit_email or User#notification_email, the primary email is used instead. While the behavior is the same, the code is different:

  • Non-database: User#commit_email is not set in the database until set by the user. The commit_email getter method is overridden to return the primary email if there is no database value.
  • Database: User#notification_email is set in the database via a callback when blank.

These attributes are both intended to capture user input, so as a general rule we should not be setting database values without user input. Also, these attributes are intended to have the same behavior, so should be coded the same.

This MR modifies the User#notification_email attribute to use the non-database approach. The intent of this change is to help standardize the behavior of secondary email attributes, as part of a broader refactoring.

Does this MR meet the acceptance criteria?

Conformity

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

Edited by Dan Jensen

Merge request reports