Jennifer Richards
32054111df
fix: fix failing tests and eliminate naive datetime warnings ( #4402 )
...
* test: fix timestamp construction in several doc tests
* refactor: rename date2datetime to datetime_from_date and clarify code
* chore: helper to get tzinfo for PRODUCTION_TIMEZONE
* fix: fix timezone handling in make_last_call()
* test: fix datetime generation in doc.tests_charter
* refactor: remove PRODUCTION_TIMEZONE setting
Replaces the PRODUCTION_TIMEZONE setting with a constant,
DEADLINE_TZINFO, in ietf.utils.timezone.
* test: be more careful about timezone in tests_charter.py
* test: be more careful about timezone in doc/tests.py
* fix: fix timezone handling affecting doc.tests_draft
* fix: fix timezone handling affecting tests_irsg_ballot.py
* fix: fix timezone handling affecting tests_review.py
* fix: fix timezone handling affecting last ietf.doc tests
* fix: fix timezone handling affecting last ietf.group tests
* fix: fix timezone handling affecting ietf.iesg tests
* fix: handle timezones in get_8989_eligibility_querysets
* fix: handle timezones affecting ietfauth tests
* fix: return tz-aware datetime from utc_from_string
* fix: specify timezone for constants in ipr_rfc_number()
* fix: specify tz for ipr deadlines
* fix: handle timezones affecting liaisons tests
* fix: treat leap day in get_8989_eligibility_querysets()
Manual cherry-pick of 248d6474
* test: treat leap day properly in nomcom tests
* fix: fix timezone handling affecting nomcom tests
* test: fix timezone handling in review tests
* fix: fix timezone handling affecting secr.meetings tests
* fix: handle both pytz and zoneinfo timezones in ietf.utils.timezone
* fix: fix timezone handling affecting secr.proceedings tests
* refactor: use make_aware() helper in secr.meetings tests
* test: fix timezone handling in secr.telechat tests
* fix: fix timezone handling affecting stats tests
* fix: eliminate tz-naive helpers affecting sync email parsing
* fix: include timezone data when serializing DeletedEvent data
* fix: fix timezone handling affecting sync tests
* style: remove unused import
2022-09-01 13:07:28 -03:00
Jennifer Richards
ebebdbed3e
refactor: replace datetime.now and datetime.today with timezone.now ( #4211 )
...
* 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: renumber migrations
2022-08-25 13:45:16 -03:00
Jennifer Richards
0d955b6328
Refactor expirable_drafts() and its usage to speed up doc.views_search.recent_drafts view (and discourage inefficient use of the method). Commit ready for merge.
...
- Legacy-Id: 19490
2021-10-28 22:24:45 +00:00
Robert Sparks
47082fe4c5
Allow submit and expire_drafts to succeed when there is no "next" IETF meeting in the database. Fixes #3370 . Commit ready for merge.
...
- Legacy-Id: 19269
2021-08-01 17:50:35 +00:00
Jennifer Richards
e11583a87f
Allow assignment of Person as "action holder" for a Doc, plus rudimentary automation of assignment. Fixes #3146 . Commit ready for merge.
...
- Legacy-Id: 18829
2021-02-12 20:31:00 +00:00
Robert Sparks
3697180cc1
Reverted merge of timezone-aware migration efforts.
...
- Legacy-Id: 18792
2021-01-12 16:54:20 +00:00
Henrik Levkowetz
774e752a54
Snapshot of timezone-aware datatracker code. Tests pass, and the test-crawler shows only expected differences. Trunk changes merged in up to r18768.
...
- Legacy-Id: 18770
2020-12-16 23:53:37 +00:00
Margaret Cullen
dbeb0e8d2d
Fixes #3032 : Only send expiration warnings for drafts with a "draft" state of "active", to match the drafts that we will actually expire. Commit ready for merge.
...
- Legacy-Id: 18723
2020-12-01 17:05:34 +00:00
Henrik Levkowetz
f10ddadc0e
Merged in changes from trunk up to r17584.
...
- Legacy-Id: 17593
2020-04-07 16:02:52 +00:00
Robert Sparks
f2b106cf8c
Remove log.assertion that was checking that we covered the edges when we changed documents to always have an iesg state. Commit ready for merge.
...
- Legacy-Id: 17495
2020-03-21 22:07:15 +00:00
Henrik Levkowetz
726fcbf27d
Removed all __future__ imports.
...
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz
ab173cb2eb
Removed further six usage: six.string_types, six.integer_types, six.moves.urllib instances.
...
- Legacy-Id: 17390
2020-03-05 20:46:58 +00:00
Henrik Levkowetz
33e8733b91
Fixed up mypy issues or added type:ignore comments as needed for a clean mypy run.
...
- Legacy-Id: 16772
2019-09-30 15:42:18 +00:00
Henrik Levkowetz
41c6bbf62e
Merged in [16563] from housley@vigilsec.com:
...
Improve performance for a few pages
- Legacy-Id: 16613
Note: SVN reference [16563] has been migrated to Git commit 765ce0d0b0
2019-08-04 15:44:06 +00:00
Russ Housley
765ce0d0b0
Improve performance for a few pages
...
- Legacy-Id: 16563
2019-07-20 22:59:26 +00:00
Henrik Levkowetz
2d7c9629aa
Added 'from __future__' imports all over the place, to bring code behaviour into closer alignment between python2 and python3
...
- Legacy-Id: 16446
2019-07-15 15:40:51 +00:00
Henrik Levkowetz
06daf6ac65
Changed regex strings to raw strings.
...
- Legacy-Id: 16312
2019-06-27 18:08:02 +00:00
Henrik Levkowetz
d7f5c84182
Initial 2to3 patch with added copyright statement updates.
...
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Robert Sparks
003e472d04
Protect drafts in certain IRTF states from expiring. Fixes #2669 . Commit ready for merge.
...
- Legacy-Id: 16109
2019-03-28 08:48:35 +00:00
Robert Sparks
6118975620
Added an explicit ID-Exists state for the IESG state machine. Reworked code so that the IESG state machine always has a state. Added the ability to release a document from a working group, research group, or the independent stream. Releasing a document removes all stream state, and sets the document to have no stream.
...
- Legacy-Id: 15809
2018-12-11 22:38:05 +00:00
Henrik Levkowetz
4f83548b49
Added a new field Meeting.days to capture the length of a meeting. This is necessary now that we have previous meetings officially starting Sunday, lasting to Friday, and future meetings starting Saturday, Lasting to Friday. We use Meeting.days to calculate Meeting.end_date(). Meeting.get_ietf_monday() and two cut_off() methods have also been updated to be instance methods instead of class methods, and to not assume that a meeting starts on Sunday.
...
- Legacy-Id: 14225
2017-10-25 13:38:15 +00:00
Henrik Levkowetz
4daf66d11c
Added DocEvent rev= parameter througout the code.
...
- Legacy-Id: 12978
2017-03-06 15:08:21 +00:00
Ole Laursen
86c3a430d1
Merge in ^/branch/iola/event-saving-refactor-r10076, fixing a few problems
...
- Legacy-Id: 10298
2015-10-27 10:37:06 +00:00
Ole Laursen
e1f0917659
Summary: Add new document saving API, Document.save_with_history(events).
...
The new API requires at least one event and will automatically save a
snapshot of the document and related state. Document.save() will now
throw an exception if called directly, as the new API is intended to
ensure that documents are saved with both an appropriate snapsnot and
relevant history log, both of which are easily defeated by just
calling .save() directly.
To simplify things, the snapshot is generated after the changes to a
document have been made (in anticipation of coming changes), instead
of before as was usual.
While revising the existing code to work with this API, a couple of
missing events was discovered:
- In draft expiry, a "Document has expired" event was only generated
in case an IESG process had started on the document - now it's
always generated, as the document changes its state in any case
- Synchronization updates like title and abstract amendmends from the
RFC Editor were silently (except for RFC publication) applied and
not accompanied by a descriptive event - they now are
- do_replace in the Secretariat tools now adds an event
- Proceedings post_process in the Secretariat tools now adds an event
- do_withdraw in the Secretariat tools now adds an event
A migration is needed for snapshotting all documents, takes a while to
run. It turns out that a single document had a bad foreign key so the
migration fixes that too.
- Legacy-Id: 10101
2015-09-28 14:01:03 +00:00
Robert Sparks
f5b6465e81
mailtoken becomes mailtrigger
...
- Legacy-Id: 10090
2015-09-17 20:03:45 +00:00
Robert Sparks
90c3426e2f
updated mailtoken utilities to match the model refactor. Morphed all the code using the utilities to match. Added paths to get Cc through as needed. Next up: Recipient selection form for the iesg save-and-send-email workflow
...
- Legacy-Id: 10040
2015-08-23 18:15:06 +00:00
Robert Sparks
89f038a1e3
checkpoint
...
- Legacy-Id: 10019
2015-08-17 20:24:16 +00:00
Henrik Levkowetz
381d37986c
Python's pathlib is now available for both 2.x and 3.x, and is well established. Removed the ietf/utils/path.py fallback, and added pathlib to requirements.txt
...
- Legacy-Id: 9161
2015-03-07 17:17:50 +00:00
Henrik Levkowetz
5a6819832f
Prevent 500 errors on file move race condition.
...
- Legacy-Id: 8480
2014-10-26 13:19:38 +00:00
Henrik Levkowetz
a03ee6b333
Changed the code to move drafts from the active draft repository to the draft archive so that all associated files will be moved, not just those with specifically listed extensions. This fixes the problem that .xml files associated with submitted drafts were moved to the unknown_ids subdirectory of the archive, instead of into the archive proper.
...
- Legacy-Id: 7922
2014-06-16 16:23:18 +00:00
Henrik Levkowetz
b9c38d3c06
Merged pyflakes fixes forward to new copy of trunk.
...
- Legacy-Id: 7463
2014-03-15 16:27:05 +00:00
Henrik Levkowetz
5bef5d11ae
Made doc/ pyflakes-clean.
...
- Legacy-Id: 7462
2014-03-15 16:09:47 +00:00
Henrik Levkowetz
b297c67765
Merged [7396] from rcross@amsl.com: updated test for clean_up_draft_files.
...
- Legacy-Id: 7401
Note: SVN reference [7396] has been migrated to Git commit 852509c96d983e595fa082e13b771a7f89771803
2014-03-04 17:47:26 +00:00
Ole Laursen
87ca10d122
Remove usage of log_state_changed (and duplicate in
...
doc/utils_charter.py) in favour of add_state_change_event which has
slightly better API but otherwise does basically the same except it
sets an event type we can later search for. Also expand tests slightly
to exercise three more templates.
- Legacy-Id: 7129
2014-01-15 17:52:00 +00:00
Ole Laursen
6ac0920af0
Move idrfc/ templates to doc/ and subdirectories in doc/, move ported ballot_icon template tag, delete dead code
...
- Legacy-Id: 6052
2013-08-14 14:10:46 +00:00
Ole Laursen
742dbace24
Move views and templatetags from idrfc/ to doc, the I-D specific views
...
go into views_draft.py and tests in tests_draft.py; what's left in
idrfc is wrapper code, templates and the ballot_icon templatetag
- Legacy-Id: 6051
2013-08-14 10:32:25 +00:00