Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
yp05327 committed Aug 22, 2023
1 parent bc65c9a commit 5807b8c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions routers/web/repo/issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -1253,16 +1253,16 @@ func roleDescriptor(ctx stdCtx.Context, repo *repo_model.Repository, poster *use
if !poster.IsAdmin {
roleDescriptor = roleDescriptor.WithRole(issues_model.RoleDescriptorOwner)
return roleDescriptor, nil
} else {
// Otherwise check if poster is the real repo admin.
ok, err := access_model.IsUserRealRepoAdmin(repo, poster)
if err != nil {
return issues_model.RoleDescriptorNone, err
}
if ok {
roleDescriptor = roleDescriptor.WithRole(issues_model.RoleDescriptorOwner)
return roleDescriptor, nil
}
}

// Otherwise check if poster is the real repo admin.
ok, err := access_model.IsUserRealRepoAdmin(repo, poster)
if err != nil {
return issues_model.RoleDescriptorNone, err
}
if ok {
roleDescriptor = roleDescriptor.WithRole(issues_model.RoleDescriptorOwner)
return roleDescriptor, nil
}
}

Expand All @@ -1280,7 +1280,7 @@ func roleDescriptor(ctx stdCtx.Context, repo *repo_model.Repository, poster *use
}

// If the poster is the collaborator of the repo
if isCollaborator, err := repo_model.IsCollaborator(ctx, repo.ID, poster.ID); err != err {
if isCollaborator, err := repo_model.IsCollaborator(ctx, repo.ID, poster.ID); err != nil {
return issues_model.RoleDescriptorNone, err
} else if isCollaborator {
roleDescriptor = roleDescriptor.WithRole(issues_model.RoleDescriptorCollaborator)
Expand Down

0 comments on commit 5807b8c

Please sign in to comment.