Skip to content
Snippets Groups Projects
Unverified Commit 56449ffc authored by Henne Vogelsang's avatar Henne Vogelsang Committed by GitHub
Browse files

Merge pull request #7854 from hennevogel/backport/fix_7844

Fix saving of project meta if containing current user as maintainer
parents eddb168c 67cfb0b8
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,10 @@ class SourceProjectMetaController < SourceController
project = Project.new(name: @project_name)
project.update_from_xml!(@request_data)
# FIXME3.0: don't modify send data
project.relationships.build(user: User.session!, role: Role.find_by_title!('maintainer'))
maintainer_role = Role.find_by_title!('maintainer')
unless project.relationships.any? { |relationship| relationship.user == User.session! && relationship.role == maintainer_role }
project.relationships.find_or_initialize_by(user: User.session!, role: maintainer_role)
end
end
project.store(comment: params[:comment])
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment