Commit graph

137 commits

Author SHA1 Message Date
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 6c260a5b7e Merge 7.45.1.dev0 into Bootstrap 5 update branch. Made a first pass at reconciling differences.
- Legacy-Id: 19945
2022-02-17 20:09:49 +00:00
Jennifer Richards 6f3fb6930f Add timeouts to requests library calls. Fixes #3498. Commit ready for merge.
- Legacy-Id: 19839
2022-01-13 15:06:28 +00:00
Lars Eggert a5cbf5307e More fixes
- Legacy-Id: 19835
2022-01-12 11:54:00 +00:00
Lars Eggert 81805e8d04 bg-default -> bg-secondary
- Legacy-Id: 19627
2021-11-10 20:08:57 +00:00
Lars Eggert bb5810a934 Labels are badges in bs5.
- Legacy-Id: 19616
2021-11-10 11:15:46 +00:00
Jim Fenton 6ec7347f8d Added IESG document state to review request information. Fixes #3235. Commit ready for merge.
- Legacy-Id: 19081
2021-06-04 21:00:58 +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
Robert Sparks c8361aba80 Repair warning call for duplicate review submission. Improve testing. Additional fix for #3092. Commit ready for merge.
- Legacy-Id: 18627
2020-10-22 21:04:37 +00:00
Henrik Levkowetz 29d1a0b362 Merged in [18533] from rjsparks@nostrum.com:
Replaced review name collision resolution code with a decision to not save when it occurs. Fixes #3092.
 - Legacy-Id: 18559
Note: SVN reference [18533] has been migrated to Git commit 0ff5172a89d5a7ad48cb1fd03b1c8926e26e50f9
2020-10-04 13:36:44 +00:00
Henrik Levkowetz 57938b039d Converted many cases of plain-text 403 messages to use a properly styled page instead, with a login link when appropriate. Also changed some API endpoint 400 responses to a more correct 403.
- Legacy-Id: 18339
2020-08-06 10:59:52 +00:00
Henrik Levkowetz f10ddadc0e Merged in changes from trunk up to r17584.
- Legacy-Id: 17593
2020-04-07 16:02:52 +00:00
Henrik Levkowetz 87bf4e8d58 Make sure to strip possible mail header field values of whitespace before applying email.utils.unquite(). Resolution by kivinen@iki.fi, Fixes issue #2899.
- Legacy-Id: 17485
2020-03-21 17:34:37 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz bea0c59d6e Fixed a string vs list issue for Message from form case.
- Legacy-Id: 17338
2020-02-26 17:01:00 +00:00
Henrik Levkowetz fcb6806d17 Merged in work from sasha@dashcare.nl on Review Queue Managemnt:
This abstracts queue management, making it possible to implement different
policies for each team. It provides two concrete policies:
RotateAlphabeticallyReviewerQueuePolicy, which rotates an alphabetically
ordered reviewer list with consideration for skip indications, and is the
default policy; and LeastRecentlyUsedReviewerQueuePolicy, a simple
least-recently-used policy.  Also see issues #2721 and #2656.
 - Legacy-Id: 17121
2019-12-04 23:02:52 +00:00
Henrik Levkowetz 2bc5606986 Merged in [17070] from sasha@dashcare.nl:
Fix #2061 - Improve 'complete review' workflow for secretaries.
When a secretary completes a review, 'link to a review message'
is automatically selected, and the first non-reply mail is used to
fill in the review details. The secretary can still modify all details.
The order of fields for secretaries is also modified to fit this workflow.
All cases where 'link to review message' is used, by reviewers or
secretaries, now attempt to fill in the 'reviewed version' if found
in the email subject.
 - Legacy-Id: 17105
Note: SVN reference [17070] has been migrated to Git commit dc9546211f
2019-11-26 20:22:56 +00:00
Henrik Levkowetz 7ec09554bb Merged in [17069] from sasha@dashcare.nl:
Fix #2074, fix #2358 - Add history for assignments, requests and unavailability.
 - Legacy-Id: 17104
Note: SVN reference [17069] has been migrated to Git commit 65d84155b6
2019-11-26 16:09:43 +00:00
Sasha Romijn 10a7bee637 Merge reviewer-queue-management on top of 6.111.1.dev0
- Legacy-Id: 17094
2019-11-22 12:35:28 +00:00
Sasha Romijn dc9546211f Fix #2061 - Improve "complete review" workflow for secretaries.
When a secretary completes a review, "link to a review message"
is automatically selected, and the first non-reply mail is used to
fill in the review details. The secretary can still modify all details.
The order of fields for secretaries is also modified to fit this workflow.

All cases where "link to review message" is used, by reviewers or
secretaries, now attempt to fill in the "reviewed version" if found
in the email subject.

Commit ready for merge.
 - Legacy-Id: 17070
2019-11-20 14:25:05 +00:00
Sasha Romijn 65d84155b6 Fix #2074, fix #2358 - Add history for assignments, requests and unavailability.
Commit ready for merge.
 - Legacy-Id: 17069
2019-11-20 11:29:14 +00:00
Sasha Romijn 0c0980c641 Fix #2420 - Add reviewer back to top of the queue after rejected/withdrawn reviews.
- Legacy-Id: 17058
2019-11-19 10:57:56 +00:00
Henrik Levkowetz 20eb9d8ac1 Merged in [16939] from sasha@dashcare.nl:
Fix #2050 - Allow adding review wishes from document and search pages.
On the main page of a document and in document search results, a new
button allows review team members to add a review wish for that document.

For reviewers that are only on one team, this essentially works
identical to tracking a document. Reviewers that are on multiple teams
are lead through an intermediate step to select a review team, and then
returned to their search or document page.
 - Legacy-Id: 16985
Note: SVN reference [16939] has been migrated to Git commit 6e55f26dbd
2019-11-11 14:22:54 +00:00
Sasha Romijn b5a31c3c6a Update some terminology and docstrings.
- Legacy-Id: 16983
2019-11-11 12:31:16 +00:00
Henrik Levkowetz c565dca35b Fixed some .format() calls.
- Legacy-Id: 16967
2019-11-05 22:38:54 +00:00
Sasha Romijn eab14ea1c5 Early work to extract reviewer policy from review/utils.py.
- Legacy-Id: 16950
2019-10-31 15:01:14 +00:00
Henrik Levkowetz 0f12d477ad Merged in [16927] from sasha@dashcare.nl:
Refs #2217 - Small cleanup from changeset [16924]
 - Legacy-Id: 16947
Note: SVN reference [16924] has been migrated to Git commit 871a4b653b

Note: SVN reference [16927] has been migrated to Git commit 730e64d253
2019-10-30 17:02:01 +00:00
Sasha Romijn 6e55f26dbd Fix #2050 - Allow adding review wishes from document and search pages.
On the main page of a document and in document search results, a new
button allows review team members to add a review wish for that document.

For reviewers that are only on one team, this essentially works
identical to tracking a document. Reviewers that are on multiple teams
are lead through an intermediate step to select a review team, and then
returned to their search or document page.

Commit ready for merge.
 - Legacy-Id: 16939
2019-10-29 16:27:56 +00:00
Henrik Levkowetz c606461b22 Merged in [16924] from sasha@dashcare.nl:
Fix #2217 - Allow submission of unsolicited reviews by secretaries.
- For team secretaries, a button 'Submit unsolicited review' will now
  appear next to 'Request review' on the document's main page.
- If the secretary is a secretary for multiple teams, they are taken
  through an intermediate page to select for which team they are
  submitting their review.
- The form is similar (and using the same code) as the usual review
  completion, with a few extra fields for the review type and reviewer,
  which would usually already be known.
- When submitting the review, a ReviewRequest and ReviewAssignment are
  automatically created. The assignment is then immediately closed in
  the usual way.
- Other workflows are unchanged.
The issues with the review form in #2061 are slightly worse for the
unsolicited review scenario, but that will be improved when #2061 is
fixed.
 - Legacy-Id: 16932
Note: SVN reference [16924] has been migrated to Git commit 871a4b653b
2019-10-26 21:16:53 +00:00
Henrik Levkowetz 00fb8d4b43 Merged in [16923] from sasha@dashcare.nl:
Fix #2087 - Show doc authors and WG chairs in unassigned reviews views.
 - Legacy-Id: 16931
Note: SVN reference [16923] has been migrated to Git commit 93797b3fc1
2019-10-26 20:26:21 +00:00
Sasha Romijn 730e64d253 Refs #2217 - Small cleanup from changeset [16924]
Commit ready for merge.
 - Legacy-Id: 16927
Note: SVN reference [16924] has been migrated to Git commit 871a4b653b
2019-10-26 08:04:31 +00:00
Sasha Romijn 871a4b653b Fix #2217 - Allow submission of unsolicited reviews by secretaries.
- For team secretaries, a button "Submit unsolicited review" will now
  appear next to "Request review" on the document's main page.
- If the secretary is a secretary for multiple teams, they are taken
  through an intermediate page to select for which team they are
  submitting their review.
- The form is similar (and using the same code) as the usual review
  completion, with a few extra fields for the review type and reviewer,
  which would usually already be known.
- When submitting the review, a ReviewRequest and ReviewAssignment are
  automatically created. The assignment is then immediately closed in
  the usual way.
- Other workflows are unchanged.

The issues with the review form in #2061 are slightly worse for the
unsolicited review scenario, but that will be improved when #2061 is
fixed.

Commit ready for merge.
 - Legacy-Id: 16924
2019-10-24 12:37:59 +00:00
Sasha Romijn 93797b3fc1 Fix #2087 - Show doc authors and WG chairs in unassigned reviews views.
Commit ready for merge.
 - Legacy-Id: 16923
2019-10-24 07:25:47 +00:00
Henrik Levkowetz 3e9bad1c8b Merged in [16883] from sasha@dashcare.nl:
Fix #2277 - Do not allow reviewers to reject overdue reviews.
If a review request is past the deadline, reviewers will no longer be
able to reject the assignment.
 - Legacy-Id: 16909
Note: SVN reference [16883] has been migrated to Git commit 3c2b01b3ff
2019-10-22 20:59:13 +00:00
Henrik Levkowetz 9e21c011f6 Merged in [16854] from rjsparks@nostrum.com:
Remove some pre-ReviewAssignment refactor logic, and simplify what remains while still allowing a group secretary to not assign a row on the unassigned requests form after touching the control to assign a reviewer. Fixes #2812.
 - Legacy-Id: 16900
Note: SVN reference [16854] has been migrated to Git commit b158807134e2d26b3e013b6414b6fcbaa0e39f77
2019-10-22 12:43:56 +00:00
Sasha Romijn 3c2b01b3ff Fix #2277 - Do not allow reviewers to reject overdue reviews.
If a review request is past the deadline, reviewers will no longer be
able to reject the assignment.

Commit ready for merge.
 - Legacy-Id: 16883
2019-10-21 14:15:08 +00:00
Henrik Levkowetz 77abc3868e Type checking tweaks.
- Legacy-Id: 16867
2019-10-15 16:54:33 +00:00
Henrik Levkowetz a895e19882 Merged in [16770] from rjsparks@nostrum.com:
Populate completed_on when rejecting a ReviewAssignment. Migrate past rejected assignments accordingly. Fixes #2782.
 - Legacy-Id: 16841
Note: SVN reference [16770] has been migrated to Git commit 661e4c5369dc0d165bfcb56e3278906fe1de3b55
2019-10-08 12:46:49 +00:00
Henrik Levkowetz 8c71252fee Merged in [16688] from sasha@dashcare.nl:
Fix #2478 - When completing review, show which addresses it is posted to.
 - Legacy-Id: 16795
Note: SVN reference [16688] has been migrated to Git commit 68ea11a916
2019-10-01 15:02:03 +00:00
Henrik Levkowetz 25ac3b67f5 Merged in [16680] from sasha@dashcare.nl:
Fix #2354 - Make review_completed configurable per team and review type
This includes a migration to change mailtrigger slugs to be up to 64
characters instead of 32, as some slugs would not fit and require clunky
abbreviations.
A data migration creates triggers for existing teams, and they are also
created on the fly if a trigger does not exist yet, providing a safe
fallback for new review teams. The review_completed mailtrigger serves
as the template for new triggers.
This commit also includes tests for gather_address_lists(), as none
existed.
 - Legacy-Id: 16794
Note: SVN reference [16680] has been migrated to Git commit 1390ae073c
2019-10-01 13:35:52 +00:00
Henrik Levkowetz 632423aa6c Merged in [16670] from sasha@dashcare.nl:
Fix #2590 - Allow secretary to adjust date when completing a review.
This also fixes other issues identified in #2590, around the
modification of historical document events. The behaviour is now:
- When the assigned reviewer posts a review, a single event is
  created, set to current date/time.
- When the secretary records a review in the datatracker, they may
  set a different completion date, which is autofilled if an email
  is selected. One event is generated for the original completion
  date, and one for the secretary's action.
- Each revision generates a new event, rather than updating previous
  existing events.
 - Legacy-Id: 16791
Note: SVN reference [16670] has been migrated to Git commit 3942f9acc7
2019-10-01 12:05:04 +00:00
Henrik Levkowetz 10c8596664 Merged in [16667] from sasha@dashcare.nl:
Fix #2071 - Add optional comment field for close request.
 - Legacy-Id: 16786
Note: SVN reference [16667] has been migrated to Git commit 4669b0934b
2019-09-30 20:55:16 +00:00
Sasha Romijn 68ea11a916 Fix #2478 - When completing review, show which addresses it is posted to.
Commit ready for merge.
 - Legacy-Id: 16688
2019-09-02 15:52:26 +00:00
Sasha Romijn 1390ae073c Fix #2354 - Make review_completed configurable per team and review type
This includes a migration to change mailtrigger slugs to be up to 64
characters instead of 32, as some slugs would not fit and require clunky
abbreviations.
A data migration creates triggers for existing teams, and they are also
created on the fly if a trigger does not exist yet, providing a safe
fallback for new review teams. The review_completed mailtrigger serves
as the template for new triggers.
This commit also includes tests for gather_address_lists(), as none
existed.

Commit ready for merge.
 - Legacy-Id: 16680
2019-08-30 17:40:55 +00:00
Sasha Romijn 3942f9acc7 Fix #2590 - Allow secretary to adjust date when completing a review.
This also fixes other issues identified in #2590, around the
modification of historical document events. The behaviour is now:
- When the assigned reviewer posts a review, a single event is
  created, set to current date/time.
- When the secretary records a review in the datatracker, they may
  set a different completion date, which is autofilled if an email
  is selected. One event is generated for the original completion
  date, and one for the secretary's action.
- Each revision generates a new event, rather than updating previous
  existing events.
 - Legacy-Id: 16670
2019-08-26 12:58:31 +00:00
Sasha Romijn 4669b0934b Fix #2071 - Add optional comment field for close request. Commit ready for merge.
- Legacy-Id: 16667
2019-08-23 11:37:41 +00:00
Robert Sparks 01ceeba131 Guard against attempts to use the review request view with a ReviewRequest id that does not match the document for the ReviewRequest. This would have exposed #2776 much earlier. Commit ready for merge.
- Legacy-Id: 16649
2019-08-14 16:06:13 +00:00
Henrik Levkowetz 8c6eb3a30a Python2/3 compatibility: Changed the use of open() and StringIO to io.open() etc.
- Legacy-Id: 16458
2019-07-15 19:14:04 +00:00