summaryrefslogtreecommitdiffstats
path: root/modules/convert
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-19 12:41:40 +0100
committerGitHub <noreply@github.com>2021-11-19 12:41:40 +0100
commit7a0347315995b25bcb2dca4786504fb699b5f004 (patch)
tree803dfd39286216fd0521ad16539ffd9fc5f87fc0 /modules/convert
parentPrevent double sanitize (#16386) (diff)
downloadforgejo-7a0347315995b25bcb2dca4786504fb699b5f004.tar.xz
forgejo-7a0347315995b25bcb2dca4786504fb699b5f004.zip
Use a standalone struct name for Organization (#17632)
* Use a standalone struct name for Organization * recover unnecessary change * make the code readable * Fix template failure * Fix template failure * Move HasMemberWithUserID to org * Fix test * Remove unnecessary user type check * Fix test Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/convert')
-rw-r--r--modules/convert/convert.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/convert/convert.go b/modules/convert/convert.go
index 80d5ffff05..4229e6cc7d 100644
--- a/modules/convert/convert.go
+++ b/modules/convert/convert.go
@@ -277,10 +277,10 @@ func ToDeployKey(apiLink string, key *models.DeployKey) *api.DeployKey {
}
// ToOrganization convert models.User to api.Organization
-func ToOrganization(org *models.User) *api.Organization {
+func ToOrganization(org *models.Organization) *api.Organization {
return &api.Organization{
ID: org.ID,
- AvatarURL: org.AvatarLink(),
+ AvatarURL: org.AsUser().AvatarLink(),
UserName: org.Name,
FullName: org.FullName,
Description: org.Description,