Commit graph

50 commits

Author SHA1 Message Date
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 d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Henrik Levkowetz 426870b766 Merged in the Document and DocAlias primary key change and m2m work in ^/personal/henrik/6.96.1-docalias.
- Legacy-Id: 16261
2019-06-15 12:00:48 +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 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 bb4fe3fbbf Undid previous commit
- Legacy-Id: 16153
2019-04-22 19:22:42 +00:00
Robert Sparks 334767fa6f Some admin tweaks and removal of a dead template. Tests all pass now. Functionality is still not right.
- Legacy-Id: 16032
2019-03-14 19:14:33 +00:00
Henrik Levkowetz 3b8d9ae832 Merged in [15684] from rjsparks@nostrum.com:
Removed the field and widget that made editing document states easier on the document admin page since they do not survive validation failure of other fields on the form. Excluded states from the modelform since the default states widget is almost impossible to use without producing bad data. If states need to be edited through the admin, it will, for now, need to be done gruelingly through the admin form for State. Fixes #2524.
 - Legacy-Id: 15700
Note: SVN reference [15684] has been migrated to Git commit 128c0a6dbb
2018-11-03 09:01:59 +00:00
Robert Sparks 128c0a6dbb Removed the field and widget that made editing document states easier on the document admin page since they do not survive validation failure of other fields on the form. Excluded states from the modelform since the default states widget is almost impossible to use without producing bad data. If states need to be edited through the admin, it will, for now, need to be done gruelingly through the admin form for State. Fixes #2524. Commit ready for merge.
- Legacy-Id: 15684
2018-11-03 04:28:50 +00:00
Henrik Levkowetz 22a2e29db8 Added an send_email field to BallotPostitionDocEvent to reflect whether the 'Send email' button was used to save the ballot position. Reverted a different earlier schema change which had the same purpose. Added icons on documents' IESG evaluation record to reflect this.
- Legacy-Id: 15526
2018-10-07 15:08:17 +00:00
Henrik Levkowetz cfb214c48a Added a BallotCommentDocEvent, which extends DocEvent with a send_mail field, in order to better be able to show whether ballot discusses and comments were posted with with the 'send email' button or not.
- Legacy-Id: 15515
2018-10-01 13:31:17 +00:00
Henrik Levkowetz 9fe1820640 Tweaked the 'Related documents' part of the Document admin page to more intuitively show the relationships.
- Legacy-Id: 15259
2018-06-14 19:22:55 +00:00
Henrik Levkowetz 92d425fd9b Added 'Additional URLs' for documents, the same way we have them for groups.
This could be used to point to a document source repository, to extracted
  yang module files, document wikis, and other relevant resources.
 - Legacy-Id: 14166
2017-09-27 10:52:32 +00:00
Henrik Levkowetz 4dad8cdf9a Added a test to check for missing admin models, and added the admin models that were currently missing.
- Legacy-Id: 14021
2017-08-01 14:00:29 +00:00
Ole Laursen 5b677dc6ba Merge author stats branch into new branch from trunk
- Legacy-Id: 13159
2017-03-28 14:36:40 +00:00
Henrik Levkowetz 05d57f6577 Added a 'rev' field to DocEvent, and removed the corresponding field from NewRevisionDocEvent and SubmissionDocEvent. Added a migration for an initial schema change, one data migration to copy and infer revision information, another schema migration to remove extraneous revision field, and another data migration to fix up bad timestamps and bad revision info from the period 2016-09-10 to 2016-10-04.
- Legacy-Id: 12974
2017-03-05 19:59:27 +00:00
Henrik Levkowetz dd305e0d87 Fixed a bug in the StateAdmin list_filter setting.
- Legacy-Id: 12972
2017-03-04 16:19:29 +00:00
Henrik Levkowetz 9bbd50119f Added a filter bar for state-type to the admin page for doc.models.State.
- Legacy-Id: 12968
2017-03-04 13:45:08 +00:00
Ole Laursen b2ff10b0f2 Add support for extracting the country line from the author addresses
to the draft parser (incorporating patch from trunk), store the
extracted country instead of trying to turn it into an ISO country
code, add country and continent name models and add initial data for
those, add helper function for cleaning the countries, add author
country and continent charts, move the affiliation models to
stats/models.py, fix a bunch of bugs.
 - Legacy-Id: 12846
2017-02-15 18:43:57 +00:00
Ole Laursen ef251c6bc7 Add author affiliation chart.
Also add a model for registering an alias for an affiliation so that
we can group affiliations that are considered the same for statistical
purposes, and a model for registering unimportant endings like Inc.
and GmbH.

Affiliation grouping is done through three means: stripping
uninteresting endings, merging entries that only differ in case and
aliases that map from case-insensitive alias to name.

Stripping endings and merging based on case seem to reduce the number
of needed manually maintained aliases greatly.
 - Legacy-Id: 12785
2017-02-03 18:49:43 +00:00
Ole Laursen 9308948195 Add person, affiliation and country (through django-countries) to
DocumentAuthor, rename author field to email and make it optional (for
modeling old email-less submissions), remove the authors many to many
referencing field from Document as it is not really pointing the right
place.

Update the Secretariat tools to show affiliation and country.

Add migration for getting rid of the fake email addresses that the
migration script created some years ago (just set the author email
field to null).
 - Legacy-Id: 12739
2017-01-26 17:10:08 +00:00
Henrik Levkowetz 6de7be6953 Specified strip=False for another bunch of CharField form fields with Textarea widgets.
- Legacy-Id: 12711
2017-01-23 17:38:56 +00:00
Henrik Levkowetz e3ce2a9657 Tweaked the admin for doc.models.Document to capture a comment about changes made, and save those in the document history, using .save_with_history(). This makes the admin useful again for doing document changes. See issue #2067.
- Legacy-Id: 12434
2016-12-01 16:35:23 +00:00
Henrik Levkowetz 27abaae2e4 Tweaked and enhanced doc.admin.DocEventAdmin.
- Legacy-Id: 12276
2016-11-07 18:38:34 +00:00
Henrik Levkowetz 5f03d70bd7 Added admin support for the DocumentAuthor model.
- Legacy-Id: 12089
2016-10-05 15:16:46 +00:00
Henrik Levkowetz a9f879cd0e Tweaked admin models.
- Legacy-Id: 12071
2016-10-01 13:36:31 +00:00
Henrik Levkowetz 846a02c3f9 Fixed pyflakes complaints introduced with pyflakes 1.1.0
- Legacy-Id: 10896
2016-03-04 21:24:26 +00:00
Ole Laursen 8bca1b4b33 Summary: Make name the primary key for DocAlias.
This fixes Javascript widgets working with DocAliases, such as the
replaces field in draft submission, to work better with Javascript
disabled. It also makes sense from a modelling perspective as the name
really is a unique key for the alias.

The actual transformation requires a series of migrations taking a
couple of minutes to complete. The actual switch to the key is done at
the end.

Branch ready for merge.
 - Legacy-Id: 10111
2015-09-30 13:47:33 +00:00
Henrik Levkowetz 6596a858af Fixed a problem with the admin interface for the ietf.doc.DocHistory class.
- Legacy-Id: 8693
2014-11-14 00:21:54 +00:00
Henrik Levkowetz 5bef5d11ae Made doc/ pyflakes-clean.
- Legacy-Id: 7462
2014-03-15 16:09:47 +00:00
Ole Laursen ea24f5c3bd Import slugify from django.utils.text (introduced in Django 1.5)
- Legacy-Id: 6967
2013-12-18 10:00:58 +00:00
Ole Laursen 0006b9ddcc Make sure all model forms have a Meta.fields attribute
- Legacy-Id: 6927
2013-12-13 17:20:02 +00:00
Henrik Levkowetz e678659b56 Merged in a lot of shim-layer removals from olau@iola.dk
(-r5194:5465 from branch/iola/shimfree).  Copying relevant
commit messages here:

  - Removed .related many to many relationship, it's not really useful
    since we always have to restrict on the relationship type anyway,
    instead add two helpers for doing the necessary queries (in both
    directions)

  - Added migration for transforming the .desc on the new_revision events
    into something more akin to what is actually shown in the history page

  - Added migration for blanking IESG notes that just consist of "RFC
    XXXX", these have been superfluous for some time

  - Grant stream chairs access to changing the stream on a draft

  - Hacked the format_history_text filter to be less weird, using the same
    formatting for snippets and full text, also link up legacy ballot set
    events

  - Moved the decoraters + utilities to new ietfauth/utils.py file

  - Added simple helper to Email to identify invalid email addresses (from
    legacy author entries)

  - Used new new_revision .desc format for when drafts are submitted

  - Improved the looks of the button class by adding extra contrast and a
    linear gradient. Currently the gradient is only visible in fairly
    recent browsers.

  - Rewrote draft and RFC tabs in terms of the new schema, porting
    write-up and history tabs as well

  - Fixed two bugs in RFC Editor syncing: make sure documents we don't know
    beforehand get a "draft" type and make sure individually submitted
    drafts get the type="individ" group instead of NULL

  - Made the CSS-styled button feel a bit nicer to use by flattening the
    active state, also introduce some temporary styles until browsers
    catch up with the standard syntax

  - Added migrations for fixing 1) a dummy RFC entry, 2) three stand-alone
    RFCs that didn't get their doc.type set, 3) a big bunch of historic
    stand-alone RFCs that have doc.group=None - set these to the
    individual submission "none" group for the time being so the view code
    doesn't have to deal with a special case.

    In some cases this is wrong since there actually was a WG associated
    but unfortunately fixing them properly requires detective work
    (probably parsing the RFCs) and in at least some cases recreating
    historic WGs. In case someone ends up doing this, the documents to
    check can still be found with

    Document.objects.filter(name__startswith="rfc", group__type="individ")
    since there are almost no new RFCs that didn't went through the I-D
    process.

  - Merged the I-D and RFC views by showing I-D information on RFCs too.
    I-Ds that have been published as RFCs redirect to the RFC URL. Also
    support alias URLs so e.g. /doc/bcpXXXX redirects to /doc/rfcXXXX.

  - Fixed revision augmentation so events after RFC publication gets a "RFC"
    designation

  - Fixed a bug with tabs not using provided name but rather doc.name

  - Displaying draft-iesg state rather than doc.friendly_state as IESG state,
    also show a notice that the IESG state refers to post-RFC processing
    if it does, like the old separate RFC page did

  - Fixed the RFC number doc.note migration to catch combined "RFC XXX; BCP
    XXX" notes too, use the opportunity to remove inserted HTML tags from
    notes and rely on linebreaksbr filter instead (the other thing was a
    left-over from the Perl days), update the various uses of the note to
    reflect that

  - Refactored slightly to make views_doc.py independent of other idrfc code

  - Moveed idrfc/views_doc.py to doc/ with associated templates, replace the
    somewhat fragile simple URL tests for views_doc.py with ordinary unit
    tests. The new tests are still fairly basic but at least test more
    than the URL tests did.

  - Made sure RFC's (and BCP/STD/FYI) are stored as RFC123 instead of
    RFC0123 in the alias table with a new migration and a change to the
    RFC Editor sync, this in turn makes /doc/std1/ do the right thing

  - Now /doc/std1/ works, we can actually do a local link in
    urlize_ietf_docs rather than linking to the tools.ietf.org server

  - Fixed history text formatter: sanitize HTML before adding linebreaks and
    non-breaking spaces, this cuts the time to render a history page with
    long comments in half

  - Added a test crawler that walks through the crawlable part of the site,
    reporting errors and slow pages

  - Got rid of initial "No record" positions when showing old positions,
    it's just noise

  - Added a .select_related() to the document main tab to reduce the number
    of DB queries, unfortunately it seems it doesn't really help with
    Django 1.2.x due to a bug (Document inherits from DocumentInfo which
    makes things a bit more complicated)

  - Introduced a simple cache in doc.get_state so repeated reads don't
    cause a DB query

  - Cleaned up the search code in preparation for removal of the shim-layer;
    use a static button and don't send extraneous GET parameters

  - Removed dead code in several places
 - Legacy-Id: 5830
2013-07-15 20:55:24 +00:00
Henrik Levkowetz 2f3476690f In order that document states (which may be used by old documents) should not need to be removed when state machines change and states go out of use, all document states have a 'used' field. The code which accesses the state fields have not been requiring that used=True for the states returned, which is an error. Fixed this by adding 'used=True' to all State.objects.get() and State.objects.filter() call where it's relevant.
- Legacy-Id: 5486
2013-03-05 23:24:41 +00:00
Ole Laursen 6e45e5e17b Remove .related many to many relationship, it's not really useful
since we always have to restrict on the relationship type anyway,
instead add two helpers for doing the necessary queries (in both
directions)
 - Legacy-Id: 5205
2013-01-16 14:15:18 +00:00
Ole Laursen a77b2ae0ab Add missing admin entries for StateDocEvent and ConsensusDocEvent
- Legacy-Id: 5006
2012-11-05 13:32:31 +00:00
Henrik Levkowetz 798f7697af Merged [4600] from rjsparks@nostrum.com:
* Adds a new document type for conflict reviews, with a ballot for the IESG 5742 response to a review request
* Integrated the new document type into the iESG agenda views (including RSS feeds)* Removed the Edit and Add buttons from the document main view.
* Replaced Add with actions appropriate for the document type, such as "Begin IESG Processing" or "Begin IETF Conflict Review", and made most data directly editable on the document's main page, depending on access permissions.
* Removed a manual editing step that the secretariat had to perform when sending conflict review messages. The view now composes the message correctly given the stream.
* Added a pencil icon motif to differentiate fields that are editable.
* Generalized several views and helper functions to use Document instead of (e.g.) IdWrapper
* Generalized reading documents from the repository
* Added a way to get from IdWrapper  to the underlying Document to facilitate migrating way from the Wrapper classes* Added many helpers to Document to assist with migrating off IdWrapper
* Minor fixes and other changes
  * Fixes to document main view to avoid (silent) template failures. 
  * Began removing some of the code that is no longer reachable post-migration  * Corrected the behavior of the undefer code and added test cases for it
  * Improved initial population of notification lists and added the ability to regenerate the initial list
* Made the test code that scans for template coverage more robust
* Deployment notes:
  * new setting: CONFLICT_REVIEW_PATH. The associated directory will need to be created

This branch fixes bugs #805, #744 and #812
 - Legacy-Id: 4652
Note: SVN reference [4600] has been migrated to Git commit 798e7a50e7
2012-07-28 16:29:28 +00:00
Henrik Levkowetz aa65e63dff Add admin support for RelatedDocument.
- Legacy-Id: 4637
2012-07-27 21:21:11 +00:00
Henrik Levkowetz 225e1a8e3a Reverting previous commit, going back to rev 4633. (Commit all made in error, only one file intended).
- Legacy-Id: 4635
2012-07-27 21:16:12 +00:00
Henrik Levkowetz 3176bea4a1 Added new RFC-Editor state tag 'AUTH48-DONE' to the rfc-ed-queue mirror script.
- Legacy-Id: 4634
2012-07-27 21:08:01 +00:00
Robert Sparks 51ab8123d9 merged in from 4.20-ise
- Legacy-Id: 4502
2012-06-22 20:25:17 +00:00
Henrik Levkowetz 741b85926b Fix signature of DocEventAdmin method (needs explicit 'self' parameter)
- Legacy-Id: 4381
2012-05-04 11:44:15 +00:00
Henrik Levkowetz bcd28cc45f Merged in fixes to the migration from olau@iola.dk. Merged in charter branch from olau@iola.dk. Added various fixes and correction of merge errors.
- Legacy-Id: 4353
2012-05-02 19:35:32 +00:00
Ole Laursen e4a9d8c7aa Finish ballot support for charters (apart from non-generic ballot
deferral), remove a bunch of now obsolete charter code.
 - Legacy-Id: 4255
2012-04-04 18:09:03 +00:00
Ole Laursen a9817e555a Some fixes to generic doc ballot view, fix edit position and send
ballot comment email views, moving them to
/doc/foo-bar/ballot/[id]/position/ and ../emailposition/.
 - Legacy-Id: 4249
2012-04-03 14:53:38 +00:00
Ole Laursen 837823f8ae Make sure HTML id does't containt spaces
- Legacy-Id: 4246
2012-04-02 17:05:10 +00:00
Henrik Levkowetz 0dd2563b22 Tweak the admin interface for Documents a bit.
- Legacy-Id: 4153
2012-03-21 14:20:29 +00:00
Henrik Levkowetz 9ea97b8674 Show doc author inline in DocumentAdmin.
- Legacy-Id: 4056
2012-03-07 10:06:27 +00:00
Ole Laursen 46139d2486 Fix up DocEvent admin
- Legacy-Id: 3911
2012-02-08 12:31:00 +00:00
Ole Laursen 980d4e6444 Move new schema models from redesign/ to ietf/
- Legacy-Id: 3855
2012-01-24 17:17:24 +00:00
Renamed from redesign/doc/admin.py (Browse further)