Skip to content

Fix method set_pages_access_level

Yongbo li请求将fix_pages_access_level合并到main-jh

What does this MR do and why?

!1499 (merged) override pages_access_level which made pages_access_level always return private so the original set_pages_acees_level will skip '=' apart, which cause 'not null violation' when create project_feature

  def set_pages_access_level
    self.pages_access_level ||= if ::Gitlab::Pages.access_control_is_forced?
                                  PRIVATE
                                else
                                  self.project&.public? ? ENABLED : PRIVATE
                                end
  end

See The test part was skipped because I can't reproduce the error in the spec.

Buglink : https://dev-ops.gitlab.cn/gitlab-cn/quality/staging/-/pipelines/173263/failures #2821 (closed)

Screenshots or screen recordings

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Yongbo li 编辑于

合并请求报告

加载中