datatracker/ietf/utils
Jennifer Richards 8b52d27b02
refactor: refactor timestamp handling so tests in meeting app pass (#4371)
* refactor: replace datetime.now with timezone.now

* refactor: migrate model fields to use timezone.now as default

* refactor: replace datetime.today with timezone.now

datetime.datetime.today() is equivalent to datetime.datetime.now(); both
return a naive datetime with the current local time.

* refactor: rephrase datetime.now(tz) as timezone.now().astimezone(tz)

This is effectively the same, but is less likely to encourage accidental
use of naive datetimes.

* refactor: revert datetime.today() change to old migrations

* refactor: change a missed datetime.now to timezone.now

* chore: renumber timezone_now migration

* chore: add migration to change timestamps to UTC

* refactor: move tz instantiation/caching from TimeSlot to Meeting

* fix: assume utc if meeting.time_zone is blank

* chore: make datetime.combine() calls tz aware in the meeting app

* ci: correctly use meeting.tz in TimeSlotFactory

* chore: compute TimeSlot utc / local times assuming tz-aware times

* chore: use tzaware math for agenda editor timeslot layout

* chore: fill in Meeting.time_zone where it is blank

Nearly all interim meetings on or before 2016-07-01 have blank
time_zone values. This migration fills these in with PST8PDT.

* chore: disallow blank Meeting.time_zone value

* refactor: no need to handle blank time_zone case in TZ migration

* refactor: remove now-unnecessary checks that meeting has time_zone

* chore: fix timezone handling in agenda.ics and Meeting.updated()

* chore: fix tz handling in interim_request_details, exercise in tests

* chore: fix timezone handling for test_interim_send_announcement

* chore: fix timezone handling in agenda_json()

* chore: fix timezone handling in old agenda

* chore: fix timezone handling for EditTimeslotsTests

* refactor: refactor a few fixes for more consistent timezone handling

* chore: add timezone info to timestamps in fixtures

* chore: remove naive datetime warnings found in meetings.tests_views

* chore: fix a few more test failures in meetings.tests_views

All tests in meetings.tests_views now passing

* chore: remove unused import

* chore: fix timezone handling in test_schedule_generator.py

* chore: fix timezone handling affecting meeting.tests_js

* chore: fix timeslot test bug when local date != UTC date

* test: fix a few failing tests, all meetings tests now pass

(for me, anyway)

* chore: renumber migrations

* chore: update timestamp conversion migration

The django-celery-beat package introduces tables with timestamp
columns. These columns are stored in CELERY_TIMEZONE. Because we run with
this set to UTC, the migration ignores these columns.

* chore: fix pytz-related change in migration

* chore: remove duplicate migrations

* chore: remove CELERY_BEAT_TZ_AWARE setting now that USE_TZ is True

* test: avoid failure in test with bogus timezone
2022-08-26 16:53:19 -03:00
..
management refactor: replace datetime.now and datetime.today with timezone.now (#4211) 2022-08-25 13:45:16 -03:00
migrations chore: migrate timestamps for use with USE_TZ=True (#4370) 2022-08-26 13:03:19 -03:00
templatetags fix: Fix removetags (#4226) 2022-07-18 09:39:11 -05:00
.gitignore * Moved utility functions into utils/ directory, and started breaking out 2007-05-11 15:48:45 +00:00
__init__.py Cleaned out some (arbitrary) submodule name imports into ietf.utils, and made the corresponding import statements import the names directly from the correct submodules. 2014-03-16 07:09:38 +00:00
accesstoken.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
admin.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
aliases.py Log Unicode exception instead of printing them to the console when they occur building the email alias files. 2021-03-09 21:19:11 +00:00
bootstrap.py And more fixes. 2022-02-01 07:47:25 +00:00
crawlurls.txt Merged in [19713] from lars@eggert.org: 2021-12-01 22:50:13 +00:00
db.py Guard against absent 'form_class' kwarg in IETFJSONField.formfield(). Commit ready for merge. 2021-11-18 15:54:46 +00:00
decorators.py refactor: replace datetime.now and datetime.today with timezone.now (#4211) 2022-08-25 13:45:16 -03:00
draft.py feat: Celery support and asynchronous draft submission API (#4037) 2022-08-22 13:29:31 -05:00
draft_search.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
fields.py feat: only offer IAB/IESG members for bofreq responsible leadership (#4276) 2022-07-26 11:23:00 -05:00
hedgedoc.py feat: improve notes imports by using de-gfm -4. Related to #3851. (#3930) 2022-05-03 18:04:48 -05:00
history.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
html.py fix: Fix removetags (#4226) 2022-07-18 09:39:11 -05:00
jstest.py fix: offset scrollspy so righthand-nav highlights the correct entry (#3820) 2022-04-14 15:35:07 -03:00
log.py Updated log.assertion() to provide an exception object (under Py3, it seems that logging.Logger instances ignore the traceback if there isn't also an exception object). Added a check for unset draft-iesg state to Document.set_state(). 2020-09-18 14:15:02 +00:00
mail.py refactor: replace datetime.now and datetime.today with timezone.now (#4211) 2022-08-25 13:45:16 -03:00
markdown.py feat: Render the document shepherd writeup templates at two new URLs (#4225) 2022-07-22 13:43:02 -05:00
markup_txt.py Many more HTML fixes. 2022-02-03 07:49:34 +00:00
meetecho.py Use correct UTC time when creating Meetecho conferences. Fixes #3565. Commit ready for merge. 2022-02-23 20:51:18 +00:00
mime.py Merged in ^/trunk@17617. 2020-04-14 17:11:51 +00:00
models.py Added a utility function to convert objects to dictionaries (for comparison, for instance) 2020-03-19 22:42:43 +00:00
ordereddict.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
patch.py Made the patch utility return information to distinguish already patched files from successful patch application, and modified our checks extensions to signal when patches have been applied and a ccommand needs to be re-run. 2020-08-20 11:36:46 +00:00
pdf.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
pipe.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
resources.py Added 'from __future__' imports all over the place, to bring code behaviour into closer alignment between python2 and python3 2019-07-15 15:40:51 +00:00
response.py test: Validate HTML rendered during tests (#3782) 2022-04-07 13:30:38 -03:00
serialize.py Reverted merge of timezone-aware migration efforts. 2021-01-12 16:54:20 +00:00
storage.py Added a pylint rc-file, and fixed or silenced a number of issues found by pylint using the settings .pylintrc (which enable only error checking). 2016-09-08 14:48:59 +00:00
test_data.py refactor: replace datetime.now and datetime.today with timezone.now (#4211) 2022-08-25 13:45:16 -03:00
test_draft_with_references_v2.xml Find references from submitted XML instead of rendering to text and parsing. Fixes #3342. Commit ready for merge. 2022-01-07 17:53:23 +00:00
test_draft_with_references_v3.xml Merged in [19895] from jennifer@painless-security.com: 2022-01-31 16:54:14 +00:00
test_runner.py refactor: replace datetime.now and datetime.today with timezone.now (#4211) 2022-08-25 13:45:16 -03:00
test_smtpserver.py fix: avoid mutables as defaults. Compute date default arguments at runtime rather than loadtime. (#4144) 2022-07-06 14:39:36 -05:00
test_textupload.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
test_utils.py test: Validate HTML rendered during tests (#3782) 2022-04-07 13:30:38 -03:00
tests.py fix: test web manifest (#4047) 2022-06-02 11:10:11 -05:00
tests_hedgedoc.py Add ability to import session minutes from notes.ietf.org. Mock out calls to the requests library in tests. Call markdown library through a util method. Fixes #3489. Commit ready for merge. 2021-12-09 17:16:19 +00:00
tests_meetecho.py refactor: replace datetime.now and datetime.today with timezone.now (#4211) 2022-08-25 13:45:16 -03:00
tests_restapi.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
texescape.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
text.py feat: Celery support and asynchronous draft submission API (#4037) 2022-08-22 13:29:31 -05:00
textupload.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
timezone.py refactor: refactor timestamp handling so tests in meeting app pass (#4371) 2022-08-26 16:53:19 -03:00
urls.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
validators.py Snapshot of dev work to add session purpose annotation 2021-10-12 17:08:58 +00:00
xmldraft.py feat: Celery support and asynchronous draft submission API (#4037) 2022-08-22 13:29:31 -05:00