Skip to content

Conversation

zuzuviewer
Copy link
Contributor

@zuzuviewer zuzuviewer commented May 14, 2022

Fix duplicate entry error when add a team member(#19697)


// check in transaction
isAlreadyMember, err = organization.IsTeamMember(ctx, team.OrgID, team.ID, userID)
if err != nil || isAlreadyMember {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But err is nil when isAlreadyMember is true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will return nil than, this should be fine

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 14, 2022
@lafriks lafriks added this to the 1.17.0 milestone May 14, 2022
Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realistically this all needs to be in a single transaction but will work

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels May 14, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 14, 2022
@lafriks lafriks merged commit 77e9346 into go-gitea:main May 14, 2022
@zuzuviewer zuzuviewer deleted the 19697 branch May 14, 2022 15:03
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 14, 2022
* giteaofficial/main:
  Fix duplicate entry error when add team member (go-gitea#19702)
  [Refactor] convert team(s) to apiTeam(s) (go-gitea#13745)
AbdulrhmnGhanem pushed a commit to kitspace/gitea that referenced this pull request Aug 24, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants