Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
9585dc78
Commit
9585dc78
authored
Oct 11, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the UserWasRemoved flag to make api aware of what happened to return correct message to UI
parent
5b5cb662
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
pkg/api/org_users.go
+4
-0
pkg/models/org_user.go
+1
-0
pkg/services/sqlstore/org_users.go
+2
-0
No files found.
pkg/api/org_users.go
View file @
9585dc78
...
@@ -125,5 +125,9 @@ func removeOrgUserHelper(cmd *m.RemoveOrgUserCommand) Response {
...
@@ -125,5 +125,9 @@ func removeOrgUserHelper(cmd *m.RemoveOrgUserCommand) Response {
return
Error
(
500
,
"Failed to remove user from organization"
,
err
)
return
Error
(
500
,
"Failed to remove user from organization"
,
err
)
}
}
if
cmd
.
UserWasRemoved
{
return
Success
(
"User deleted"
)
}
return
Success
(
"User removed from organization"
)
return
Success
(
"User removed from organization"
)
}
}
pkg/models/org_user.go
View file @
9585dc78
...
@@ -75,6 +75,7 @@ type RemoveOrgUserCommand struct {
...
@@ -75,6 +75,7 @@ type RemoveOrgUserCommand struct {
UserId
int64
UserId
int64
OrgId
int64
OrgId
int64
ShouldDeleteOrphanedUser
bool
ShouldDeleteOrphanedUser
bool
UserWasRemoved
bool
}
}
type
AddOrgUserCommand
struct
{
type
AddOrgUserCommand
struct
{
...
...
pkg/services/sqlstore/org_users.go
View file @
9585dc78
...
@@ -194,6 +194,8 @@ func RemoveOrgUser(cmd *m.RemoveOrgUserCommand) error {
...
@@ -194,6 +194,8 @@ func RemoveOrgUser(cmd *m.RemoveOrgUserCommand) error {
if
err
:=
deleteUserInTransaction
(
sess
,
&
m
.
DeleteUserCommand
{
UserId
:
user
.
Id
});
err
!=
nil
{
if
err
:=
deleteUserInTransaction
(
sess
,
&
m
.
DeleteUserCommand
{
UserId
:
user
.
Id
});
err
!=
nil
{
return
err
return
err
}
}
cmd
.
UserWasRemoved
=
true
}
}
return
nil
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment