mirror of
https://github.com/go-gitea/gitea
synced 2025-01-26 21:57:45 +01:00
parent
2f09e5775f
commit
a6290f603f
@ -13,6 +13,10 @@ import (
|
|||||||
// ToUser convert models.User to api.User
|
// ToUser convert models.User to api.User
|
||||||
// signed shall only be set if requester is logged in. authed shall only be set if user is site admin or user himself
|
// signed shall only be set if requester is logged in. authed shall only be set if user is site admin or user himself
|
||||||
func ToUser(user *models.User, signed, authed bool) *api.User {
|
func ToUser(user *models.User, signed, authed bool) *api.User {
|
||||||
|
if user == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
result := &api.User{
|
result := &api.User{
|
||||||
ID: user.ID,
|
ID: user.ID,
|
||||||
UserName: user.Name,
|
UserName: user.Name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user