DeleteCustomAvatar deletes the current user custom avatar and falls back to use look up avatar by email.
(ctx context.Context, userID int64)
| 348 | // DeleteCustomAvatar deletes the current user custom avatar and falls back to |
| 349 | // use look up avatar by email. |
| 350 | func (s *UsersStore) DeleteCustomAvatar(ctx context.Context, userID int64) error { |
| 351 | _ = os.Remove(userutil.CustomAvatarPath(userID)) |
| 352 | return s.db.WithContext(ctx). |
| 353 | Model(&User{}). |
| 354 | Where("id = ?", userID). |
| 355 | Updates(map[string]any{ |
| 356 | "use_custom_avatar": false, |
| 357 | "updated_unix": s.db.NowFunc().Unix(), |
| 358 | }). |
| 359 | Error |
| 360 | } |
| 361 | |
| 362 | type ErrUserOwnRepos struct { |
| 363 | args errutil.Args |