diff options
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go index fda3bb5eab..213b5f76ab 100644 --- a/models/user.go +++ b/models/user.go @@ -1244,6 +1244,10 @@ func deleteUser(e *xorm.Session, u *User) error { // DeleteUser completely and permanently deletes everything of a user, // but issues/comments/pulls will be kept and shown as someone has been deleted. func DeleteUser(u *User) (err error) { + if u.IsOrganization() { + return fmt.Errorf("%s is an organization not a user", u.Name) + } + sess := x.NewSession() defer sess.Close() if err = sess.Begin(); err != nil { |