Skip to content

Conversation

@deronnax
Copy link
Collaborator

Current time zone handling of django-appointment is incorrect.
settings.TIME_ZONE is a fallback from the past for when correct time zone support was not present in Django. Now timezones works perfectly fine and you are not suppose to use the TIME_ZONE. Just use get_current_timezone() and let django handle the current user's timezone for you.

@deronnax deronnax marked this pull request as draft March 28, 2024 12:46
@codecov
Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 95.18%. Comparing base (078d0ca) to head (547d5d7).
Report is 7 commits behind head on main.

Files Patch % Lines
appointment/views.py 62.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
- Coverage   95.20%   95.18%   -0.02%     
==========================================
  Files          49       49              
  Lines        5751     5732      -19     
==========================================
- Hits         5475     5456      -19     
  Misses        276      276              
Flag Coverage Δ
unittests 95.18% <75.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@deronnax deronnax force-pushed the use-current-timezome branch from d8c7d72 to ea85dd0 Compare March 28, 2024 12:51
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 28, 2024
@deronnax deronnax changed the title don't manually rely on settings.TIME_ZONE let django handle the timezone Mar 28, 2024
@deronnax deronnax marked this pull request as ready for review March 28, 2024 14:09
@adamspd adamspd requested review from adamspd and removed request for adamspd March 29, 2024 19:26
@deronnax
Copy link
Collaborator Author

I am fine with the PR. We can merge it if you are fine too.

@deronnax deronnax force-pushed the use-current-timezome branch from 9f500c5 to 9c52d80 Compare March 30, 2024 18:43
@github-actions github-actions bot added dependencies Pull requests that update a dependency file publishing labels Mar 30, 2024
@deronnax
Copy link
Collaborator Author

And since we don't manually manipulate timezone anymore, we don't use pytz anymore and we can now remove it. I had to edit a commit already committed for the git history to remain clean sorry, you will probably have to do a git pull --rebase. Sorry for the inconvenience, I do this sparingly I promise.

@adamspd
Copy link
Owner

adamspd commented Mar 30, 2024

And since we don't manually manipulate timezone anymore, we don't use pytz anymore and we can now remove it. I had to edit a commit already committed for the git history to remain clean sorry, you will probably have to do a git pull --rebase. Sorry for the inconvenience, I do this sparingly I promise.

Don't worry, git manipulations is part of my daily routine nowadays because of my line of work, learning it the hard way.

@adamspd
Copy link
Owner

adamspd commented Mar 30, 2024

I am fine with the PR. We can merge it if you are fine too.

I'll try to fix the codecov error and then we merge. I'm fine with it too. Wondering if it's not time to do a 3.4.0 release...

@deronnax
Copy link
Collaborator Author

I think it's worth doing a 3.4.0 release: when you change a lot of things, it's good to release often otherwise a release brings too many changes and people never migrate.

@adamspd
Copy link
Owner

adamspd commented Mar 30, 2024

I think it's worth doing a 3.4.0 release: when you change a lot of things, it's good to release often otherwise a release brings too many changes and people never migrate.

It's just this line in init.py file to change. GitHub Actions will take care of the rest and create the release.

@adamspd adamspd enabled auto-merge March 30, 2024 21:18
@adamspd adamspd disabled auto-merge March 30, 2024 21:21
@adamspd adamspd merged commit d6855b3 into main Mar 30, 2024
@adamspd adamspd deleted the use-current-timezome branch March 30, 2024 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation publishing tests user-interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants