You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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.
2 years ago
..
actions Treat PRs with agit flow as fork PRs when triggering actions. (#23884) 2 years ago
activities Localize activity heatmap (except tooltip) (#24131) 2 years ago
admin Implement FSFE REUSE for golang files (#21840) 2 years ago
asymkey Prefer native parser for SSH public key parsing (#23798) 2 years ago
auth Fix 500 error if there is a name conflict when edit authentication source (#23832) 2 years ago
avatars Avoid warning for system setting when start up (#23054) 2 years ago
db Allow adding new files to an empty repo (#24164) 2 years ago
dbfs Allow adding new files to an empty repo (#24164) 2 years ago
fixtures Allow adding new files to an empty repo (#24164) 2 years ago
git Fix branch protection priority (#24045) 2 years ago
issues Make more functions use ctx instead of db.DefaultContext (#24068) 2 years ago
migrations Add migration to fix external unit access mode of owner/admin team (#24117) 2 years ago
organization Add owner team permission check test (#24096) 2 years ago
packages Use ghost user if package creator does not exist (#23822) 2 years ago
perm Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
project Improve GetBoards and getDefaultBoard (#22981) 2 years ago
pull refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo Allow adding new files to an empty repo (#24164) 2 years ago
secret Secrets storage with SecretKey encrypted (#22142) 2 years ago
system Avoid warning for system setting when start up (#23054) 2 years ago
unit Improve LoadUnitConfig to handle invalid or duplicate units (#23736) 2 years ago
unittest Allow adding new files to an empty repo (#24164) 2 years ago
user Allow adding new files to an empty repo (#24164) 2 years ago
webhook Add user webhooks (#21563) 2 years ago
error.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_generation.go Implement FSFE REUSE for golang files (#21840) 2 years ago
fixture_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go Refactor the setting to make unit test easier (#22405) 2 years ago
migrate.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
migrate_test.go Check primary keys for all tables and drop ForeignReference (#21721) 2 years ago
org.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
org_team.go Fix internal sever error when visiting a PR that bound to the deleted team (#24127) 2 years ago
org_team_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
org_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo.go Avoid warning for system setting when start up (#23054) 2 years ago
repo_collaboration.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
repo_collaboration_test.go Rename `repo.GetOwner` to `repo.LoadOwner` (#22967) 2 years ago
repo_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
repo_transfer.go Always reuse transaction (#22362) 2 years ago
repo_transfer_test.go Rename almost all Ctx functions (#22071) 2 years ago