Commit graph

45 commits

Author SHA1 Message Date
Jennifer Richards da168395fc
refactor: Replace deprecated smart_text with smart_str 2023-05-09 15:23:33 -03:00
Jennifer Richards 07e26dd52e
refactor: Replace deprecated force_text with force_str 2023-05-09 15:21:50 -03:00
Jennifer Richards 56505147e0
fix: handle timezones in a bunch of places 2022-09-23 16:11:49 -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 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
Jennifer Richards 6e97a89786 Notify IRSG when an IRSG ballot is created. Fixes #2978. Commit ready for merge.
- Legacy-Id: 18162
2020-07-13 16:45:45 +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 79bb245f8a Move charters for replaced groups to a new replaced state. Close any outstanding ballots on them. Fixes #2889, #2873, and #1286. Commit ready for merge.
- Legacy-Id: 17396
2020-03-06 16:47:59 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +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
Robert Sparks 975522af35 Make a more appropriate review message when a BoF has an initial charter under consideration. Fixes #2458. Commit ready for merge.
- Legacy-Id: 14715
2018-02-28 20:54:56 +00:00
Lars Eggert 8a70e9773d Fix various "RemovedInDjango20Warning" warnings. Commit ready for merge.
- Legacy-Id: 13112
2017-03-25 19:16:45 +00:00
Henrik Levkowetz 8eb447e77f Added an improved guard against trying to fetch milestones for a group value of None.
- Legacy-Id: 12989
2017-03-08 15:19:08 +00:00
Henrik Levkowetz 707b006d17 Added a guard against trying to fetch milestones for a group value of None.
- Legacy-Id: 12988
2017-03-08 15:14:58 +00:00
Henrik Levkowetz 4daf66d11c Added DocEvent rev= parameter througout the code.
- Legacy-Id: 12978
2017-03-06 15:08:21 +00:00
Henrik Levkowetz 988a2b808f Added explicit charset setting and consistent encoding to several email paths through the datatracker. After introducing support for non-ascii names in email addresses, using role.formatted_email() to insert names into email content doesn't work any more, since uncode names will now be rfc2047-encoded in formatted_email(). Added another method role.name_and_email() for this case. Replaced another case of '%s <%s>' name-and-email formatting with formataddr(). Fixed some tests which did not send unicode email bodies to the email functions. Fixes issue #2017.
- Legacy-Id: 12896
2017-02-21 19:17:10 +00:00
Henrik Levkowetz 7a8555599f Added a link to the group datatracker page to the new group announcement (and review) emails. Fixes issue #2140.
- Legacy-Id: 12666
2017-01-17 22:22:46 +00:00
Henrik Levkowetz 4b0a9360f0 Merged in ^/branch/iola/event-saving-refactor-r10291, which refactors document saving to always use doc.save_with_history(events), and requires accompanying events. This branch also provides refactoring of recurring regexes in url patterns into a dictionary. As part of the merge, also refactored new code which didn't use the save_with_history() method.
- Legacy-Id: 11840
2016-08-23 10:52:08 +00:00
Robert Sparks 87e2653f56 Added listing all the area directors back. Related to #1889. Commit ready for merge.
- Legacy-Id: 10726
2016-01-22 21:17:44 +00:00
Robert Sparks dc2593ebe5 Tweak the rendering of Area Directors in the charter text used in new-work, internal review, external review, and group action messages to display. Fixes #1889. Commit ready to merge.
- Legacy-Id: 10723
2016-01-22 20:47:45 +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 43445307b1 Summary: Be more careful with generating announcements for charters so
they are not saved unless we're in a POST
 - Legacy-Id: 10141
2015-10-07 10:42:31 +00:00
Ole Laursen d70a1601a6 Summary: Split charter names with acronyms containing hyphen correctly
- Legacy-Id: 10139
2015-10-07 09:15:37 +00:00
Ole Laursen ec54a59cc6 Summary: Be more careful when generating writeups so that we wait with
saving newly generated writeups until we see a POST (problem found by
the test crawler)
 - Legacy-Id: 10137
2015-10-06 16:20:12 +00:00
Ole Laursen 63d96e0354 Summary: Get rid of submit_initial_charter hack, only create a charter
when a first revision has actually been submitted.
 - Legacy-Id: 10136
2015-10-06 15:14:31 +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 e5306eda00 Instrumented issuing ballots. Simplified the ballot-issued email significantly. Deferred adding ballot_saved mail for the automatic yes positions.
- Legacy-Id: 10068
2015-08-28 17:33:49 +00:00
Robert Sparks 150106619b Handle the new-work message
- Legacy-Id: 10066
2015-08-27 21:27:10 +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 f30f5c39f1 checkpoint
- Legacy-Id: 10017
2015-08-13 21:16:21 +00:00
Robert Sparks 79d373fa71 checkpoint.
- Legacy-Id: 10011
2015-08-11 21:52:28 +00:00
Robert Sparks 6c85bc558c checkpoint. Sets initial notify to empty
- Legacy-Id: 10009
2015-08-11 02:27:59 +00:00
Robert Sparks ad444bd0bc checkpoint
- Legacy-Id: 10007
2015-08-10 20:15:31 +00:00
Robert Sparks 65804be683 This is the second step towards ADs out of GroupInfo into Role.
The use of group.ad has been scrubbed from the code and templates.
  - Those places that set group.ad have been directly manipulate Role objects instead
  - Most places that read group.ad now use a new group.ad_role() that returns a Role object, simplifing some views.

Related to #1555 and #1557.

Commit ready for merge.
 - Legacy-Id: 8854
2015-01-09 18:52:06 +00:00
Robert Sparks 4c9db8f250 This is the first step towards using Role to represent Area directors. It
- Migrates the information captured in GroupInfo.ad to Role objects.
- Renames GroupInfo.ad to GroupInfo._ad (retaining the current column name) to prepare for deletion of that field.
- Provides ad property accessor and setter methods implemented using the group's role_set (so that the existing view code continues to work with minimal changes)
- Improved selection in many querysets that assumed only groups of type 'area' would have area directors.

Related to #1557 and #1555.

Commit ready to merge.
 - Legacy-Id: 8851
2015-01-08 20:22:23 +00:00
Henrik Levkowetz ec3e247732 Merged in [8262] and [8263] from rjsparks@nostrum.com:
Changes when returning_item is automatically set to match the
    current IESGs preferences.  Removes several chunks of dead code
    related to editing telechat dates.  Improves returning item tests.

    Refactored multiple edit_telechat functions into one function in
    doc_views.  Added a helper function for determining if ballots have
    changed to isolate the implementation.  Fixed the issue with
    update_agenda setting the returning item bit even when the user
    explicitly said not to.  Added prompting to encourage proper setting
    of the returning item bit to the edit_telechat view.

    Fixes #1209
 - Legacy-Id: 8369
Note: SVN reference [8262] has been migrated to Git commit 9d8d0d63e2338d6fa81a82c553b8c6a1c3a105c1

Note: SVN reference [8263] has been migrated to Git commit 35a7436b782fc45e224ac9ea29bfb535fd3ce959
2014-09-28 19:57:01 +00:00
Ole Laursen e92e57acd2 Fix an instance of charter-ietf-%s that should really be charter-%s-%s
to support RG charters properly, also remove the dead code for
handling group acronym renames (it contained some instances of
charter-ietf-%s too)
 - Legacy-Id: 7936
2014-06-26 16:24:06 +00:00
Henrik Levkowetz 5bef5d11ae Made doc/ pyflakes-clean.
- Legacy-Id: 7462
2014-03-15 16:09:47 +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 6b2d50db93 Implement missing charter tests as found by the coverage check
- Legacy-Id: 7127
2014-01-14 15:50:03 +00:00
Ole Laursen 7e00fa1424 Move the Secretariat group email utility to wginfo and the rest of the wgcharter stuff to doc/(views|urls|utils)_charter.py alongside the other document types
- Legacy-Id: 7121
2014-01-13 16:08:58 +00:00
Renamed from ietf/wgcharter/mails.py (Browse further)