From ad58459198d7744a4818ea0a512624cee58e525b Mon Sep 17 00:00:00 2001 From: Stefan Benten Date: Wed, 23 Dec 2020 16:40:44 +0100 Subject: [PATCH] satellite/admin: allow more than just "paid" invoice status during user deletion Currently we do not allow anything other than the "paid" status for invoices when trying to delete a user. However there can be a couple of other states that are still fine to accept during deletion of a user. This change reverses the order to check for the status that we do not want to allow. Change-Id: I78d85af6438015c55100fa201ccffc731c91de1c --- satellite/admin/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/satellite/admin/user.go b/satellite/admin/user.go index 1f5f980ad..6481515d5 100644 --- a/satellite/admin/user.go +++ b/satellite/admin/user.go @@ -341,7 +341,7 @@ func (server *Server) deleteUser(w http.ResponseWriter, r *http.Request) { } if len(invoices) > 0 { for _, invoice := range invoices { - if invoice.Status != "paid" { + if invoice.Status == "draft" || invoice.Status == "open" { httpJSONError(w, "user has unpaid/pending invoices", "", http.StatusConflict) return