db: fix update team panic (#6253)

* db: fix update team panic

* Update CHANGELOG
pull/6255/head
ᴜɴᴋɴᴡᴏɴ 2020-08-16 21:31:08 +08:00 committed by GitHub
parent f667d139bc
commit a961afe52b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -56,6 +56,7 @@ All notable changes to Gogs are documented in this file.
- Private repositories are hidden in the organization's view. [#5869](https://github.com/gogs/gogs/issues/5869)
- Server error when changing email address in user settings page. [#5899](https://github.com/gogs/gogs/issues/5899)
- Fall back to use RFC 3339 as time layout when misconfigured. [#6098](https://github.com/gogs/gogs/issues/6098)
- Unable to update team with server error. [#6185](https://github.com/gogs/gogs/issues/6185)
- Webhooks are not fired after push when `[service] REQUIRE_SIGNIN_VIEW = true`.
### Removed

View File

@ -179,7 +179,7 @@ func (c *Context) NotFound() {
// Error renders the 500 page.
func (c *Context) Error(err error, msg string) {
log.ErrorDepth(5, "%s: %v", msg, err)
log.ErrorDepth(4, "%s: %v", msg, err)
c.Title("status.internal_server_error")

View File

@ -348,7 +348,7 @@ func UpdateTeam(t *Team, authChanged bool) (err error) {
t.LowerName = strings.ToLower(t.Name)
existingTeam := new(Team)
has, err := x.Where("org_id=?", t.OrgID).And("lower_name=?", t.LowerName).And("id!=?", t.ID).Get(&existingTeam)
has, err := x.Where("org_id=?", t.OrgID).And("lower_name=?", t.LowerName).And("id!=?", t.ID).Get(existingTeam)
if err != nil {
return err
} else if has {