diff options
author | Joe Chen <jc@unknwon.io> | 2022-10-22 20:01:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-22 20:01:38 +0800 |
commit | ce25881c880d9711f211be05f92a809304a436e3 (patch) | |
tree | 9239c155c8276761de6639fd19b0a56e87eedde5 /internal/db/org.go | |
parent | 7cbd84d5b3d4af36e4afcf7af9374bc765f6bb9c (diff) |
refactor(db): move some methods off `user.go` (#7199)
Diffstat (limited to 'internal/db/org.go')
-rw-r--r-- | internal/db/org.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/db/org.go b/internal/db/org.go index c5c55f44..93350746 100644 --- a/internal/db/org.go +++ b/internal/db/org.go @@ -14,6 +14,7 @@ import ( "xorm.io/xorm" "gogs.io/gogs/internal/errutil" + "gogs.io/gogs/internal/userutil" ) var ErrOrgNotExist = errors.New("Organization does not exist") @@ -131,7 +132,7 @@ func CreateOrganization(org, owner *User) (err error) { if _, err = sess.Insert(org); err != nil { return fmt.Errorf("insert organization: %v", err) } - _ = org.GenerateRandomAvatar() + _ = userutil.GenerateRandomAvatar(org.ID, org.Name, org.Email) // Add initial creator to organization and owner team. if _, err = sess.Insert(&OrgUser{ |