refactor: update user timezone retrieval in get_user function #2442
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When creating a helpdesk ticket the users sees it as a action in the past but its happend recently. This is because the frontend is using timezone from the user. In this case timezone of the user is same as the system timezone as well but still this occoured. Ideally this should should show the same x minutes ago in all timezone but it is not working that way. Since the document creation and other time is based on the system time instead of the user time its better to use system's time itself in all place to fix that issue
Screen.Recording.2025-08-05.at.11.44.26.AM.mov
Changelog
This pull request updates how the user's time zone is handled in the
get_user
function inhelpdesk/api/auth.py
. Instead of retrieving the user's individual time zone from the database, the system-wide time zone is now used.User time zone handling:
time_zone
field from theUser
doctype and replaced it with the system-wide time zone usingget_system_timezone()
in the returned user dictionary. [1] [2]get_system_timezone
fromfrappe.utils
to support the new time zone logic.