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
@project
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)
rescue => e
@project.errors.add(:base, e.message) if @project
......@@ -122,8 +122,9 @@ module Projects
only_concrete_membership: true)
if group_access_level > GroupMember::NO_ACCESS
current_user.project_authorizations.create!(project: @project,
access_level: group_access_level)
current_user.project_authorizations.safe_find_or_create_by!(
project: @project,
access_level: group_access_level)
end
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