diff options
author | 6543 <6543@obermui.de> | 2020-02-04 15:27:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 16:27:18 +0200 |
commit | d4096ab6a284ce2c36305428459fd75dcb2e4ee5 (patch) | |
tree | bf549fa86daa1262aa64e3d823addee2c3e6d5b1 /models/org_test.go | |
parent | b3c72a7c4a935e805b87ff2e1911429628ace7c5 (diff) | |
download | gitea-d4096ab6a284ce2c36305428459fd75dcb2e4ee5.tar.gz gitea-d4096ab6a284ce2c36305428459fd75dcb2e4ee5.zip |
Ensure DeleteUser is not allowed to Delete Orgs and visa versa (#10134)
* add check to DeleteUser
* add check to DeleteOrganization
* add Test
* remove redundancy (deleteOrg is only used in DeleteOrganization)
* Update models/org.go
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/org_test.go')
-rw-r--r-- | models/org_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/org_test.go b/models/org_test.go index 934d5bc4a2..79f8b060e7 100644 --- a/models/org_test.go +++ b/models/org_test.go @@ -272,8 +272,8 @@ func TestDeleteOrganization(t *testing.T) { assert.Error(t, err) assert.True(t, IsErrUserOwnRepos(err)) - nonOrg := AssertExistsAndLoadBean(t, &User{ID: 5}).(*User) - assert.Error(t, DeleteOrganization(nonOrg)) + user := AssertExistsAndLoadBean(t, &User{ID: 5}).(*User) + assert.Error(t, DeleteOrganization(user)) CheckConsistencyFor(t, &User{}, &Team{}) } |