Skip to content

Return default avatar url when user id is zero rather than updating database (#34094) #34095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

GiteaBot
Copy link
Collaborator

@GiteaBot GiteaBot commented Apr 2, 2025

Backport #34094 by @lunny

When visit commit list, it would update the user avatar even if id = 0, which was unnecessary operations. This PR returned default avatar for the git only user avatar rendering who's user id is zero.

database duration=0.0005s db.sql="UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=?"
database duration=0.0007s db.sql="UPDATE `user` SET `avatar` = ?, `updated_unix` = ? WHERE `id`=?"
...

@GiteaBot GiteaBot added modifies/go Pull requests that update Go code type/bug labels Apr 2, 2025
@GiteaBot GiteaBot added this to the 1.23.7 milestone Apr 2, 2025
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 2, 2025
@techknowlogick techknowlogick enabled auto-merge (squash) April 2, 2025 01:23
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 2, 2025
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 2, 2025
@techknowlogick techknowlogick merged commit 25e409e into go-gitea:release/v1.23 Apr 2, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants