Commit 5552304f authored by Imre Farkas's avatar Imre Farkas

Merge branch 'sh-fix-issue-233862' into 'master'

Fix error 500s creating projects concurrently

See merge request gitlab-org/gitlab!48571
parents ecff75b4 f1543604
...@@ -67,7 +67,7 @@ module Projects ...@@ -67,7 +67,7 @@ module Projects
@project @project
rescue ActiveRecord::RecordInvalid => e rescue ActiveRecord::RecordInvalid => e
message = "Unable to save #{e.record.type}: #{e.record.errors.full_messages.join(", ")} " message = "Unable to save #{e.inspect}: #{e.record.errors.full_messages.join(", ")}"
fail(error: message) fail(error: message)
rescue => e rescue => e
@project.errors.add(:base, e.message) if @project @project.errors.add(:base, e.message) if @project
...@@ -122,8 +122,9 @@ module Projects ...@@ -122,8 +122,9 @@ module Projects
only_concrete_membership: true) only_concrete_membership: true)
if group_access_level > GroupMember::NO_ACCESS if group_access_level > GroupMember::NO_ACCESS
current_user.project_authorizations.create!(project: @project, current_user.project_authorizations.safe_find_or_create_by!(
access_level: group_access_level) project: @project,
access_level: group_access_level)
end end
if Feature.enabled?(:specialized_project_authorization_workers) if Feature.enabled?(:specialized_project_authorization_workers)
......
---
title: Fix error 500s creating projects concurrently
merge_request: 48571
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment