fix: every page reload fires a user updated event even when nothing changed (#34838)

Every page load sends the browser's timezone, and the server saved it and fired a user updated event each time, even when it was the timezone already stored. Webhooks and Event functions listening for that event got one per reload for every user. Now the timezone is only saved, and the event only fired, when it actually changes.

Fixes #34837
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-23 20:14:12 +04:00
1 parent 765465eed1
commit c35321f9a4
1 file changed
+2
+2
View File
@@ -296,6 +296,8 @@ async def update_timezone(
db: AsyncSession = Depends(get_async_session),
):
if session_user:
if form_data.timezone == session_user.timezone:
return {'status': True}
await Users.update_user_by_id(
session_user.id,
{'timezone': form_data.timezone},