0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-22 09:31:13 +01:00
gitea/models
sillyguodong bfecf3bd89
Fix internal sever error when visiting a PR that bound to the deleted team (#24127)
Close: #23738

The actual cause of `500 Internal Server Error` in the issue is not what
is descirbed in the issue.

The actual cause is that after deleting team, if there is a PR which has
requested reivew from the deleted team, the comment could not match with
the deleted team by `assgin_team_id`. So the value of `.AssigneeTeam`
(see below code block) is `nil` which cause `500 error`.


1c8bc4081a/templates/repo/issue/view_content/comments.tmpl (L691-L695)

To fix this bug, there are the following problems to be resolved:

- [x] 1. ~~Stroe the name of the team in `content` column when inserting
`comment` into DB in case that we cannot get the name of team after it
is deleted. But for comments that already exist, just display "Unknown
Team"~~ Just display "Ghost Team" in the comment if the assgined team is
deleted.
- [x] 2. Delete the PR&team binding (the row of which `review_team_id =
${team_id} ` in table `review`) when deleting team.
- [x] 3.For already exist and undeleted binding rows in in table
`review`, ~~we can delete these rows when executing migrations.~~ they
do not affect the function, so won't delete them.
2023-04-19 19:50:00 -04:00
..
actions
activities Localize activity heatmap (except tooltip) (#24131) 2023-04-17 14:26:01 -04:00
admin
asymkey
auth
avatars
db Allow adding new files to an empty repo (#24164) 2023-04-19 21:40:42 +08:00
dbfs Allow adding new files to an empty repo (#24164) 2023-04-19 21:40:42 +08:00
fixtures Allow adding new files to an empty repo (#24164) 2023-04-19 21:40:42 +08:00
git
issues
migrations Add migration to fix external unit access mode of owner/admin team (#24117) 2023-04-15 09:52:44 -04:00
organization Add owner team permission check test (#24096) 2023-04-19 19:19:13 -04:00
packages
perm
project
pull
repo Allow adding new files to an empty repo (#24164) 2023-04-19 21:40:42 +08:00
secret
system
unit
unittest Allow adding new files to an empty repo (#24164) 2023-04-19 21:40:42 +08:00
user Allow adding new files to an empty repo (#24164) 2023-04-19 21:40:42 +08:00
webhook
error.go
fixture_generation.go
fixture_test.go
main_test.go
migrate.go
migrate_test.go
org.go
org_team.go Fix internal sever error when visiting a PR that bound to the deleted team (#24127) 2023-04-19 19:50:00 -04:00
org_team_test.go
org_test.go
repo.go
repo_collaboration.go
repo_collaboration_test.go
repo_test.go
repo_transfer.go
repo_transfer_test.go