Skip to content

refactor: update user timezone retrieval in get_user function #2442

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

iamimmanuelraj
Copy link

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 in helpdesk/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:

  • Removed retrieval of the user's personal time_zone field from the User doctype and replaced it with the system-wide time zone using get_system_timezone() in the returned user dictionary. [1] [2]
  • Added an import for get_system_timezone from frappe.utils to support the new time zone logic.

Signed-off-by: Immanuel Raj <iamimmanuelraj@gmail.com>
@iamimmanuelraj
Copy link
Author

@RitvikSardana Can you check this and merge it ASAP? We are having issues on our production. We are running application that is operated from multiple regions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant