-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Enable timezone support and set timezone to UTC #4545
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
Conversation
All your changes look correct to me. Although, I'm not 100% sure how to test other things or where we could find issues by changing these settings. Maybe it's a good moment to upgrade |
That's what terrifies me as well. |
Sounds like it should be raising warnings in the console if we have issues, and I don't see any warnings in our tests. I'm guessing the primary issue is that we might end up with some dates in the future when we do the switch or something like that. |
All the warnings that came from executing the test suite were fixed as part of this PR. I just suspect there might be some not covered by our tests. Dates in the database should be ok. |
I'm tempted to try and merge this in. If the DB is correct, then I think we'll be alright. Thoughts? |
…-timezone-support
Codecov Report
@@ Coverage Diff @@
## master #4545 +/- ##
==========================================
+ Coverage 76.41% 76.42% +<.01%
==========================================
Files 158 158
Lines 9988 9992 +4
Branches 1262 1262
==========================================
+ Hits 7632 7636 +4
Misses 2016 2016
Partials 340 340
|
Let's aim for next week. I'll get the coverage into shape and re-run the test suite with Django 1.11. |
I'm somewhat confused by the coverage results.
I think we are ok here. |
🎉 |
Squashed commit of the following: commit b5007bb Author: Eric Holscher <[email protected]> Date: Tue Nov 20 11:41:40 2018 -0500 Clean up HTMLFile Admin commit 27e3dd4 Author: Eric Holscher <[email protected]> Date: Mon Nov 19 15:39:20 2018 -0500 Set replicas to 2 so we have 3 total copies commit ee13ed6 Merge: f221f97 ef0cd7b Author: Eric Holscher <[email protected]> Date: Tue Nov 20 11:54:57 2018 -0500 Merge remote-tracking branch 'origin/rel' into search-reapply commit f221f97 Merge: 57c7b57 7bea6d8 Author: Eric Holscher <[email protected]> Date: Mon Nov 19 15:21:00 2018 -0500 Merge pull request #4909 from safwanrahman/search_fix Tuning Elasticsearch for search improvements commit 7bea6d8 Author: Safwan Rahman <[email protected]> Date: Sat Nov 17 02:17:22 2018 +0600 more fix commit 10a6590 Author: Safwan Rahman <[email protected]> Date: Sat Nov 17 01:50:48 2018 +0600 adding comments commit 40865ae Author: Safwan Rahman <[email protected]> Date: Sat Nov 17 00:54:28 2018 +0600 fixing test commit 536874e Author: Safwan Rahman <[email protected]> Date: Sat Nov 17 00:29:34 2018 +0600 optimize for elasticsearch commit 57c7b57 Author: Eric Holscher <[email protected]> Date: Tue Nov 6 12:10:08 2018 -0600 Update migration commit a1bd6a4 Merge: 95b23c2 d2137df Author: Eric Holscher <[email protected]> Date: Tue Nov 6 12:08:38 2018 -0600 Merge branch 'master' of github.com:rtfd/readthedocs.org into search-reapply commit d2137df Merge: b63ef59 953a4ee Author: Eric Holscher <[email protected]> Date: Tue Nov 6 11:52:42 2018 -0600 Merge pull request #4545 from rtfd/davidfischer/enable-timezone-support Enable timezone support and set timezone to UTC commit 95b23c2 Merge: 75445f1 bc248aa Author: Eric Holscher <[email protected]> Date: Thu Nov 1 14:48:13 2018 -0500 Merge branch 'master' into search-reapply commit 953a4ee Merge: 0a01b96 104c3a6 Author: Eric Holscher <[email protected]> Date: Thu Nov 1 14:21:37 2018 -0500 Merge remote-tracking branch 'origin/master' into davidfischer/enable-timezone-support commit 75445f1 Author: Eric Holscher <[email protected]> Date: Wed Oct 10 15:45:29 2018 +0200 One more test commit fae116c Author: Eric Holscher <[email protected]> Date: Wed Oct 10 15:45:03 2018 +0200 Fix tests commit 5b823ad Author: Eric Holscher <[email protected]> Date: Wed Oct 10 15:43:53 2018 +0200 Don't change the query param, keep it q commit 621e14f Author: Eric Holscher <[email protected]> Date: Wed Oct 10 14:12:13 2018 +0200 Fix logic around search processing commit 5af8307 Merge: 97e3ad8 c38efc8 Author: Eric Holscher <[email protected]> Date: Wed Oct 10 12:35:16 2018 +0200 Merge remote-tracking branch 'origin/master' into search-reapply commit 97e3ad8 Author: Eric Holscher <[email protected]> Date: Thu Oct 4 09:49:59 2018 +0200 Revert "Revert "Merge pull request #4636 from rtfd/search_upgrade" (#4716)" This reverts commit 183b176. commit 0a01b96 Author: David Fischer <[email protected]> Date: Tue Sep 18 15:38:00 2018 -0700 Fix a merge fail commit 73ad35c Merge: ad7c76c ba34164 Author: David Fischer <[email protected]> Date: Tue Sep 18 15:11:48 2018 -0700 Merge branch 'master' into davidfischer/enable-timezone-support commit ad7c76c Author: David Fischer <[email protected]> Date: Tue Aug 21 12:54:05 2018 -0700 Found one more naive datetime commit 46db5d9 Author: David Fischer <[email protected]> Date: Mon Aug 20 12:09:31 2018 -0700 Enable timezone support and set timezone to UTC
The two primary changes here are:
TIME_ZONE
fromAmerica/Chicago
toUTC
.USE_TZ
toTrue
(the default isFalse
).These are the defaults for new projects in Django.
Links
Notes
Our production database is already timezone aware so I don't believe this will cause issues with the production database. Django's docs say as much but it's worth a second look.