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
b671b970
Commit
b671b970
authored
Oct 11, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed property name to UserWasDeleted and added an assert for it
parent
9585dc78
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
+6
-5
pkg/api/org_users.go
+3
-3
pkg/models/org_user.go
+1
-1
pkg/services/sqlstore/org_test.go
+1
-0
pkg/services/sqlstore/org_users.go
+1
-1
No files found.
pkg/api/org_users.go
View file @
b671b970
...
...
@@ -103,8 +103,8 @@ func updateOrgUserHelper(cmd m.UpdateOrgUserCommand) Response {
// DELETE /api/org/users/:userId
func
RemoveOrgUserForCurrentOrg
(
c
*
m
.
ReqContext
)
Response
{
return
removeOrgUserHelper
(
&
m
.
RemoveOrgUserCommand
{
UserId
:
c
.
ParamsInt64
(
":userId"
),
OrgId
:
c
.
OrgId
,
UserId
:
c
.
ParamsInt64
(
":userId"
),
OrgId
:
c
.
OrgId
,
ShouldDeleteOrphanedUser
:
true
,
})
}
...
...
@@ -125,7 +125,7 @@ func removeOrgUserHelper(cmd *m.RemoveOrgUserCommand) Response {
return
Error
(
500
,
"Failed to remove user from organization"
,
err
)
}
if
cmd
.
UserWas
Remov
ed
{
if
cmd
.
UserWas
Delet
ed
{
return
Success
(
"User deleted"
)
}
...
...
pkg/models/org_user.go
View file @
b671b970
...
...
@@ -75,7 +75,7 @@ type RemoveOrgUserCommand struct {
UserId
int64
OrgId
int64
ShouldDeleteOrphanedUser
bool
UserWas
Remov
ed
bool
UserWas
Delet
ed
bool
}
type
AddOrgUserCommand
struct
{
...
...
pkg/services/sqlstore/org_test.go
View file @
b671b970
...
...
@@ -191,6 +191,7 @@ func TestAccountDataAccess(t *testing.T) {
remCmd
:=
m
.
RemoveOrgUserCommand
{
OrgId
:
ac1
.
OrgId
,
UserId
:
ac2
.
Id
,
ShouldDeleteOrphanedUser
:
true
}
err
=
RemoveOrgUser
(
&
remCmd
)
So
(
err
,
ShouldBeNil
)
So
(
remCmd
.
UserWasDeleted
,
ShouldBeTrue
)
err
=
GetSignedInUser
(
&
m
.
GetSignedInUserQuery
{
UserId
:
ac2
.
Id
})
So
(
err
,
ShouldEqual
,
m
.
ErrUserNotFound
)
...
...
pkg/services/sqlstore/org_users.go
View file @
b671b970
...
...
@@ -195,7 +195,7 @@ func RemoveOrgUser(cmd *m.RemoveOrgUserCommand) error {
return
err
}
cmd
.
UserWas
Remov
ed
=
true
cmd
.
UserWas
Delet
ed
=
true
}
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