mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 08:02:36 +09:00 
			
		
		
		
	* fix & co * word suggestions from @jolheiser
This commit is contained in:
		@@ -7,6 +7,7 @@ package admin
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/models"
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
@@ -226,6 +227,11 @@ func DeleteUser(ctx *context.APIContext) {
 | 
				
			|||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if u.IsOrganization() {
 | 
				
			||||||
 | 
							ctx.Error(http.StatusUnprocessableEntity, "", fmt.Errorf("%s is an organization not a user", u.Name))
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := models.DeleteUser(u); err != nil {
 | 
						if err := models.DeleteUser(u); err != nil {
 | 
				
			||||||
		if models.IsErrUserOwnRepos(err) ||
 | 
							if models.IsErrUserOwnRepos(err) ||
 | 
				
			||||||
			models.IsErrUserHasOrgs(err) {
 | 
								models.IsErrUserHasOrgs(err) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -115,7 +115,7 @@ func SettingsDeleteAvatar(ctx *context.Context) {
 | 
				
			|||||||
	ctx.Redirect(ctx.Org.OrgLink + "/settings")
 | 
						ctx.Redirect(ctx.Org.OrgLink + "/settings")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// SettingsDelete response for delete repository
 | 
					// SettingsDelete response for deleting an organization
 | 
				
			||||||
func SettingsDelete(ctx *context.Context) {
 | 
					func SettingsDelete(ctx *context.Context) {
 | 
				
			||||||
	ctx.Data["Title"] = ctx.Tr("org.settings")
 | 
						ctx.Data["Title"] = ctx.Tr("org.settings")
 | 
				
			||||||
	ctx.Data["PageIsSettingsDelete"] = true
 | 
						ctx.Data["PageIsSettingsDelete"] = true
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user