Skip to content

Remove presence validation on User#public_email

Dan Jensen requested to merge djensen-remove-ignored-user-validation-rule into master

What does this MR do?

Since User#public_email was introduced in 2015, the validation rules have included both allow_blank and presence (which means not-blank). The allow_blank option takes precedence, so the presence option is ignored (we know this because the code sets public_email to an empty string that would generally fail the presence validation, and also because we confirmed with manual testing). This removes the presence option so it does not cause confusion or bugs in the future.

Interestingly, this rule conflict has not been noticed in any past changes to this line:

  1. 7b28218f in 2015 (original introduction)
  2. b34963bc in 2016
  3. b3635ee4 in 2016
  4. c8c0ea6c in 2018

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

Loading