Commit graph

143 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
Robert Sparks b988850985
fix: avoid mutables as defaults. Compute date default arguments at runtime rather than loadtime. (#4144) 2022-07-06 14:39:36 -05:00
Jennifer Richards 6df0377fa1 Fix several review reminder problems.
Send secretary's review reminders to secretary instead of assignee. 
Send unconfirmed assignment reminders based on assignment age and CC secretaries. 
Correctly separate open review reminders by review team.

Fixes #3482. Fixes #3324. Commit ready for merge.
 - Legacy-Id: 19848
2022-01-14 19:14:06 +00:00
Jennifer Richards 92c9f856a4 Refactor reviewer queue policy handling of "skip" setting. Fixes #3038. Commit ready for merge.
- Legacy-Id: 18833
2021-02-16 19:31:50 +00:00
Henrik Levkowetz 2b68095b82 Merged in [17794] from mark@painless-security.com:
Add the 'msg' variable for interpolation on reviewer availability change emails, and reformat the add-a-period email.  Fixes #2891.
 - Legacy-Id: 17799
Note: SVN reference [17794] has been migrated to Git commit 96bc71f51f150cec7043aca60d0156d35847019b
2020-05-15 11:33:03 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +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 fc0060079a Merged in [17085] from sasha@dashcare.nl:
Fix #2278 - Notify secretary when a review request is closed.
The assigned reviewer was already notified, but secretaries were always
excluded.
 - Legacy-Id: 17108
Note: SVN reference [17085] has been migrated to Git commit 56003f66d8
2019-11-27 22:19:58 +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 56003f66d8 Fix #2278 - Notify secretary when a review request is closed.
The assigned reviewer was already notified, but secretaries were always
excluded.

Commit ready for merge.
 - Legacy-Id: 17085
2019-11-21 11:03:21 +00:00
Henrik Levkowetz 424dcfb42d Some tweaks related to the changes related to #2830.
- Legacy-Id: 17076
2019-11-21 06:01:56 +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
Robert Sparks 38e73b6f89 Change the default template for assigned review emails to name the assigned reviewer. Fixes #2830. Commit ready for merge.
- Legacy-Id: 17062
2019-11-19 21:27:23 +00:00
Sasha Romijn c36fcdc5a7 Update update_policy_state_for_assignment for new policies, fix tests,
fix some other minor things.
 - Legacy-Id: 17023
2019-11-13 14:39:42 +00:00
Sasha Romijn b5a31c3c6a Update some terminology and docstrings.
- Legacy-Id: 16983
2019-11-11 12:31:16 +00:00
Robert Sparks f740adcfc1 Look at the tree of replaces-relationships when determining if some reviewer has reviewed this (or perhaps an ancestor) of this document. Fixes #2821. Commit ready for merge.
- Legacy-Id: 16981
2019-11-07 23:02:19 +00:00
Sasha Romijn e518824a69 Initial refactoring of the current reviewer assignment code.
- Legacy-Id: 16961
2019-11-05 16:39:31 +00:00
Henrik Levkowetz 77a56473c3 Merged in [16933] from sasha@dashcare.nl:
Fix #2119 - Allow specifying review type for suggested reviews in LC and telechat
If a review is suggested on the 'manage unassigned reviews' page, and
the document is in both last call and telechat, the assign form now asks
for the type of review that should be assigned.
This commit also fixes two bugs in this process:
- Comparisons in some cases between strings and integers
  (group/views.py:1485/1487)
- Rejections when assigning suggested reviews, as they could be
  considered a newly opened request due to not having a pk
  (group/views.py:1508)
 - Legacy-Id: 16951
Note: SVN reference [16933] has been migrated to Git commit ee4bc0cb07
2019-10-31 17:31:21 +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 a37bd907cc Merged in [16926] from rjsparks@nostrum.com:
Flipped a sense to put the grace period on the right side of 'today' when sending review overdue reminders to team secretaries. Fixes #2816.
 - Legacy-Id: 16940
Note: SVN reference [16926] has been migrated to Git commit 7560e116bf
2019-10-30 13:01:53 +00:00
Sasha Romijn ee4bc0cb07 Fix #2119 - Allow specifying review type for suggested reviews in LC and telechat
If a review is suggested on the "manage unassigned reviews" page, and
the document is in both last call and telechat, the assign form now asks
for the type of review that should be assigned.

This commit also fixes two bugs in this process:
- Comparisons in some cases between strings and integers
  (group/views.py:1485/1487)
- Rejections when assigning suggested reviews, as they could be
  considered a newly opened request due to not having a pk
  (group/views.py:1508)
  
Commit ready for merge.
 - Legacy-Id: 16933
2019-10-28 11:43:48 +00:00
Henrik Levkowetz 09c34fa131 Merged in [16921] from sasha@dashcare.nl:
Fix #2123 - Use a DBTemplate when a review assignment is mailed.
The message sent to a reviewer when a new review is assigned to them,
is now taken from a DBTemplate, allowing it to be customised
per team. This includes a migration to create a default template,
which looks the same as before.
 - Legacy-Id: 16928
Note: SVN reference [16921] has been migrated to Git commit 9df5839874
2019-10-26 15:16:18 +00:00
Robert Sparks 7560e116bf Flipped a sense to put the grace period on the right side of "today" when sending review overdue reminders to team secretaries. Fixes #2816. Commit ready for merge.
- Legacy-Id: 16926
2019-10-25 20:32:16 +00:00
Sasha Romijn 9df5839874 Fix #2123 - Use a DBTemplate when a review assignment is mailed.
The message sent to a reviewer when a new review is assigned to them,
is now taken from a DBTemplate, allowing it to be customised
per team. This includes a migration to create a default template,
which looks the same as before.

Commit ready for merge.
 - Legacy-Id: 16921
2019-10-23 16:06:44 +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
Henrik Levkowetz a66fa82b06 Fixed some review reminders issues.
- Legacy-Id: 16863
2019-10-15 16:46:12 +00:00
Henrik Levkowetz be641ac22a Merged in [16792] from sasha@dashcare.nl:
Fix #2475 - Send opt-in reminders for unconfirmed review assignments.
If enabled for a team, reminders will be sent every X days to reviewers
for review assignments they have not accepted or rejected.
 - Legacy-Id: 16846
Note: SVN reference [16792] has been migrated to Git commit 486b6daa29
2019-10-08 15:57:28 +00:00
Henrik Levkowetz 678f8a5787 Merged in [16765] from sasha@dashcare.nl:
Refs #2277 - Send daily reminders of overdue reviews to secretaries
 - Legacy-Id: 16839
Note: SVN reference [16765] has been migrated to Git commit cc64992204
2019-10-08 10:41:37 +00:00
Henrik Levkowetz 09e38dffa0 Merged in [16705] from sasha@dashcare.nl:
Fix #2337 - Send periodic reminders of open reviews every X days (opt-in)
The interleaved_migrations_test currently fails due to the various 
migrations that have been added for individual tickets/commits (unless
--permit-mixed-migrations is set). I think this is better fixed in a
later cleanup, as doing it now could cause confusion when merging
individual commits, and more migrations are likely to be added soon.
 - Legacy-Id: 16823
Note: SVN reference [16705] has been migrated to Git commit ec56a03ec6
2019-10-04 17:09:57 +00:00
Henrik Levkowetz 4c3e869d5c Merged in [16704] from sasha@dashcare.nl:
Fix #2231 - Send reminders before long UnavailabilityPeriods expire
A notification is sent to the team secretary and reviewer, if an
unavailability period lasting 30 days or more will end in 3 days.
 - Legacy-Id: 16822
Note: SVN reference [16704] has been migrated to Git commit 179c151f9e
2019-10-04 14:07:54 +00:00
Henrik Levkowetz 70380cb8ea Merged in [16672] from sasha@dashcare.nl:
Fix #2328 - Use mailtriggers to find destinations in review app
As the review app has several conditionals that don't fit
entirely well within mailtriggers, the templates use a bit
of extra context to figure out who exactly to include. This also
extends the tests for review, to check for correct recipients.
It also adds a tiny feature to mailtrigger to entirely exclude
certain addresses, as required by the review-generated mails.
 - Legacy-Id: 16793
Note: SVN reference [16672] has been migrated to Git commit 88b7b45b0e
2019-10-01 13:06:48 +00:00
Sasha Romijn 486b6daa29 Fix #2475 - Send opt-in reminders for unconfirmed review assignments.
If enabled for a team, reminders will be sent every X days to reviewers
for review assignments they have not accepted or rejected.

Commit ready for merge.
 - Legacy-Id: 16792
2019-10-01 13:01:19 +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 cc64992204 Refs #2277 - Send daily reminders of overdue reviews to secretaries
Commit ready for merge.
 - Legacy-Id: 16765
2019-09-30 12:27:43 +00:00
Sasha Romijn ec56a03ec6 Fix #2337 - Send periodic reminders of open reviews every X days (opt-in)
The interleaved_migrations_test currently fails due to the various 
migrations that have been added for individual tickets/commits (unless
--permit-mixed-migrations is set). I think this is better fixed in a
later cleanup, as doing it now could cause confusion when merging
individual commits, and more migrations are likely to be added soon.

Commit ready for merge.
 - Legacy-Id: 16705
2019-09-05 15:02:56 +00:00
Sasha Romijn 179c151f9e Fix #2231 - Send reminders before long UnavailabilityPeriods expire
A notification is sent to the team secretary and reviewer, if an
unavailability period lasting 30 days or more will end in 3 days.
Commit ready for merge.
 - Legacy-Id: 16704
2019-09-05 11:59:40 +00:00
Sasha Romijn 88b7b45b0e Fix #2328 - Use mailtriggers to find destinations in review app
As the review app has several conditionals that don't fit
entirely well within mailtriggers, the templates use a bit
of extra context to figure out who exactly to include. This also
extends the tests for review, to check for correct recipients.
It also adds a tiny feature to mailtrigger to entirely exclude
certain addresses, as required by the review-generated mails.

Commit ready for merge.
 - Legacy-Id: 16672
2019-08-27 15:15:13 +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 87de06c97c Corrected a view that was looking at review assignment ids when it should have been looking at request review ids. Fixes #2776. Commit ready for merge.
- Legacy-Id: 16647
2019-08-13 18:13:50 +00:00
Henrik Levkowetz bdc73e771a Python2/3 compatibility: replaced six.ensure_text() with either six.text_type or django's force_text(), depending on the case, and fixed a variable scope issue.
- Legacy-Id: 16461
2019-07-16 13:20:05 +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
Henrik Levkowetz d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Henrik Levkowetz a2cafded25 Changed DocAlias to be many-to-many, in order to be able to handle STD aliases referring to multiple RFCs.
- Legacy-Id: 16249
2019-06-14 20:38:14 +00:00
Henrik Levkowetz 815602351f This is a series of 50 migrations that changes the Document and DocAlias
primary keys from character strings to integers, and makes corresponding code
changes.

This was prompted by database limitations discovered when trying to make
DocAlias use a m2m document field; with 255 long strings as primary keys for
Document and DocAlias this violated the MySQL database limitations.

Changing the primary keys to integers should also improve efficiency.  

Due to the data migrations which create the new integer primary keys and adds
corresponding integer foreign keys matching the previous string foreign keys
in all tables having foreign keys to Document and DocAlias, some of these
migrations take a long time.  The total set of migrations are expected to have
a runtime on the order of 2 hours.
 - Legacy-Id: 16237
2019-06-10 11:32:46 +00:00
Henrik Levkowetz ca1f3340c0 Changed a ReviewAssignmentDocEvent type from 'closed_review_request' to 'closed_review_assignment', for consistency and readability.
- Legacy-Id: 16181
2019-05-02 12:38:41 +00:00
Henrik Levkowetz 8726e74709 Merged in a refactoring of document review code from rjsparks@nostrum.com. This introduces ReviewAssignments, letting us do multiple assingments for a given RevieRequest, without conflating the assignments and their results with the request itself.
- Legacy-Id: 16177
2019-04-30 16:54:06 +00:00
Henrik Levkowetz 3ec9d7b678 Updated the role handling to use GroupFeatures.groupman_roles consistently for group management access. Fixes a IRTF RG delegate permissions issue.
- Legacy-Id: 16160
2019-04-25 13:19:30 +00:00
Henrik Levkowetz bb4fe3fbbf Undid previous commit
- Legacy-Id: 16153
2019-04-22 19:22:42 +00:00