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
65847da1
Unverified
Commit
65847da1
authored
Mar 28, 2018
by
Dan Cech
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use Result in GetAuthInfoQuery
parent
d837be91
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
pkg/models/user_auth.go
+1
-1
pkg/services/sqlstore/user_auth.go
+6
-6
No files found.
pkg/models/user_auth.go
View file @
65847da1
...
...
@@ -69,5 +69,5 @@ type GetAuthInfoQuery struct {
AuthModule
string
AuthId
string
UserAuth
*
UserAuth
Result
*
UserAuth
}
pkg/services/sqlstore/user_auth.go
View file @
65847da1
...
...
@@ -28,22 +28,22 @@ func GetUserByAuthInfo(query *m.GetUserByAuthInfoQuery) error {
err
=
GetAuthInfo
(
authQuery
)
// if user id was specified and doesn't match the user_auth entry, remove it
if
err
==
nil
&&
query
.
UserId
!=
0
&&
query
.
UserId
!=
authQuery
.
UserAuth
.
UserId
{
if
err
==
nil
&&
query
.
UserId
!=
0
&&
query
.
UserId
!=
authQuery
.
Result
.
UserId
{
DeleteAuthInfo
(
&
m
.
DeleteAuthInfoCommand
{
UserAuth
:
authQuery
.
UserAuth
,
UserAuth
:
authQuery
.
Result
,
})
}
else
if
err
==
nil
{
has
,
err
=
x
.
Id
(
authQuery
.
UserAuth
.
UserId
)
.
Get
(
user
)
has
,
err
=
x
.
Id
(
authQuery
.
Result
.
UserId
)
.
Get
(
user
)
if
err
!=
nil
{
return
err
}
if
has
{
query
.
UserAuth
=
authQuery
.
UserAuth
query
.
UserAuth
=
authQuery
.
Result
}
else
{
// if the user has been deleted then remove the entry
DeleteAuthInfo
(
&
m
.
DeleteAuthInfoCommand
{
UserAuth
:
authQuery
.
UserAuth
,
UserAuth
:
authQuery
.
Result
,
})
}
}
else
if
err
!=
m
.
ErrUserNotFound
{
...
...
@@ -99,7 +99,7 @@ func GetAuthInfo(query *m.GetAuthInfoQuery) error {
return
m
.
ErrUserNotFound
}
query
.
UserAuth
=
userAuth
query
.
Result
=
userAuth
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