Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Vaultwarden
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Vaultwarden
Commits
f5fb69b6
Unverified
Commit
f5fb69b6
authored
10 months ago
by
Stefan Melmuk
Committed by
GitHub
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
also delete organization_api_key (#4557)
parent
32615344
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/db/models/organization.rs
+9
-0
9 additions, 0 deletions
src/db/models/organization.rs
with
9 additions
and
0 deletions
src/db/models/organization.rs
+
9
−
0
View file @
f5fb69b6
...
@@ -316,6 +316,7 @@ impl Organization {
...
@@ -316,6 +316,7 @@ impl Organization {
UserOrganization
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
UserOrganization
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
OrgPolicy
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
OrgPolicy
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
Group
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
Group
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
OrganizationApiKey
::
delete_all_by_organization
(
&
self
.uuid
,
conn
)
.await
?
;
db_run!
{
conn
:
{
db_run!
{
conn
:
{
diesel
::
delete
(
organizations
::
table
.filter
(
organizations
::
uuid
.eq
(
self
.uuid
)))
diesel
::
delete
(
organizations
::
table
.filter
(
organizations
::
uuid
.eq
(
self
.uuid
)))
...
@@ -886,6 +887,14 @@ impl OrganizationApiKey {
...
@@ -886,6 +887,14 @@ impl OrganizationApiKey {
.ok
()
.from_db
()
.ok
()
.from_db
()
}}
}}
}
}
pub
async
fn
delete_all_by_organization
(
org_uuid
:
&
str
,
conn
:
&
mut
DbConn
)
->
EmptyResult
{
db_run!
{
conn
:
{
diesel
::
delete
(
organization_api_key
::
table
.filter
(
organization_api_key
::
org_uuid
.eq
(
org_uuid
)))
.execute
(
conn
)
.map_res
(
"Error removing organization api key from organization"
)
}}
}
}
}
#[cfg(test)]
#[cfg(test)]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment