From 3dc0c962bf3a74188bed02c01b4d34636112805a Mon Sep 17 00:00:00 2001
From: JakobDev <jakobdev@gmx.de>
Date: Thu, 19 Oct 2023 15:16:11 +0200
Subject: Delete repos of org when purge delete user (#27273)

Fixes https://codeberg.org/forgejo/forgejo/issues/1514

I had to remove `RenameOrganization` to avoid circular import.

We should really add some foreign keys to the database.
---
 routers/api/v1/org/org.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'routers/api/v1/org/org.go')

diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go
index 4579f3b085..6fb8ecd403 100644
--- a/routers/api/v1/org/org.go
+++ b/routers/api/v1/org/org.go
@@ -385,7 +385,7 @@ func Delete(ctx *context.APIContext) {
 	//   "404":
 	//     "$ref": "#/responses/notFound"
 
-	if err := org.DeleteOrganization(ctx, ctx.Org.Organization); err != nil {
+	if err := org.DeleteOrganization(ctx, ctx.Org.Organization, false); err != nil {
 		ctx.Error(http.StatusInternalServerError, "DeleteOrganization", err)
 		return
 	}
-- 
cgit v1.2.3