Fix repo avatar conflict (#32958) (#32960)

Backport #32958 by wxiaoguang

Continue even if the avatar deleting fails

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot
2024-12-23 11:17:38 +08:00
committed by GitHub
parent d670820722
commit e1026feddc
4 changed files with 14 additions and 10 deletions

View File

@@ -61,3 +61,11 @@ func TestDeleteAvatar(t *testing.T) {
assert.Equal(t, "", repo.Avatar)
}
func TestGenerateAvatar(t *testing.T) {
templateRepo := &repo_model.Repository{ID: 10, Avatar: "a"}
generateRepo := &repo_model.Repository{ID: 11}
_ = generateAvatar(db.DefaultContext, templateRepo, generateRepo)
assert.NotEmpty(t, generateRepo.Avatar)
assert.NotEqual(t, templateRepo.Avatar, generateRepo.Avatar)
}