diff --git a/.gitignore b/.gitignore index fc1b23833..77d367a65 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ /.settings /.tmp /.factoryboy_random_state +/attic /bin /etc /ghostdriver.log diff --git a/bin/add-old-drafts-from-archive.py b/bin/add-old-drafts-from-archive.py index 195501a26..d53ab32a7 100755 --- a/bin/add-old-drafts-from-archive.py +++ b/bin/add-old-drafts-from-archive.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# Copyright The IETF Trust 2017-2019, All Rights Reserved import datetime import os @@ -79,7 +80,7 @@ for name in sorted(names): words=draft.get_wordcount(), expires=time+datetime.timedelta(settings.INTERNET_DRAFT_DAYS_TO_EXPIRE), ) - doc.docalias_set.create(name=doc.name) + DocAlias.objects.create(name=doc.name).docs.add(doc) doc.states.add(expired) # update authors authors = [] diff --git a/ietf/community/migrations/0003_add_communitylist_docs2_m2m.py b/ietf/community/migrations/0003_add_communitylist_docs2_m2m.py new file mode 100644 index 000000000..6ab7a26c7 --- /dev/null +++ b/ietf/community/migrations/0003_add_communitylist_docs2_m2m.py @@ -0,0 +1,44 @@ +# Copyright The IETF Trust 2019, All Rights Reserved +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-05-21 14:23 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion +import ietf.utils.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0002_auto_20180220_1052'), + ] + + operations = [ + migrations.CreateModel( + name='CommunityListDocs', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('communitylist', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.CommunityList')), + ('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id')), + ], + ), + migrations.AddField( + model_name='communitylist', + name='added_docs2', + field=models.ManyToManyField(related_name='communitylists', through='community.CommunityListDocs', to='doc.Document'), + ), + migrations.CreateModel( + name='SearchRuleDocs', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('document', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='doc.Document', to_field=b'id')), + ('searchrule', ietf.utils.models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='community.SearchRule')), + ], + ), + migrations.AddField( + model_name='searchrule', + name='name_contains_index2', + field=models.ManyToManyField(related_name='searchrules', through='community.SearchRuleDocs', to='doc.Document'), + ), + ] diff --git a/ietf/community/migrations/0004_set_document_m2m_keys.py b/ietf/community/migrations/0004_set_document_m2m_keys.py new file mode 100644 index 000000000..2c2db4d13 --- /dev/null +++ b/ietf/community/migrations/0004_set_document_m2m_keys.py @@ -0,0 +1,56 @@ +# Copyright The IETF Trust 2019, All Rights Reserved +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-05-21 14:27 +from __future__ import unicode_literals + +import sys + +from tqdm import tqdm + +from django.db import migrations + + +def forward(apps, schema_editor): + + Document = apps.get_model('doc','Document') + CommunityList = apps.get_model('community', 'CommunityList') + CommunityListDocs = apps.get_model('community', 'CommunityListDocs') + SearchRule = apps.get_model('community', 'SearchRule') + SearchRuleDocs = apps.get_model('community', 'SearchRuleDocs') + + # Document id fixup ------------------------------------------------------------ + + objs = Document.objects.in_bulk() + nameid = { o.name: o.id for id, o in objs.iteritems() } + + sys.stderr.write('\n') + + sys.stderr.write(' %s.%s:\n' % (CommunityList.__name__, 'added_docs')) + count = 0 + for l in tqdm(CommunityList.objects.all()): + for d in l.added_docs.all(): + count += 1 + CommunityListDocs.objects.get_or_create(communitylist=l, document_id=nameid[d.name]) + sys.stderr.write(' %s CommunityListDocs objects created\n' % (count, )) + + sys.stderr.write(' %s.%s:\n' % (SearchRule.__name__, 'name_contains_index')) + count = 0 + for r in tqdm(SearchRule.objects.all()): + for d in r.name_contains_index.all(): + count += 1 + SearchRuleDocs.objects.get_or_create(searchrule=r, document_id=nameid[d.name]) + sys.stderr.write(' %s SearchRuleDocs objects created\n' % (count, )) + +def reverse(apps, schema_editor): + pass + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0003_add_communitylist_docs2_m2m'), + ('doc', '0014_set_document_docalias_id'), + ] + + operations = [ + migrations.RunPython(forward, reverse), + ] diff --git a/ietf/community/migrations/0005_1_del_docs_m2m_table.py b/ietf/community/migrations/0005_1_del_docs_m2m_table.py new file mode 100644 index 000000000..68afc2e9f --- /dev/null +++ b/ietf/community/migrations/0005_1_del_docs_m2m_table.py @@ -0,0 +1,32 @@ +# Copyright The IETF Trust 2019, All Rights Reserved +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-05-22 08:15 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('community', '0004_set_document_m2m_keys'), + ] + + # The implementation of AlterField in Django 1.11 applies + # 'ALTER TABLE
{% for review_assignment in other_reviews %} - {% include "doc/review_assignment_summary.html" with current_doc_name=review_assignemnt.review_request.doc_id current_rev=review_assignment.reviewed_rev %} + {% include "doc/review_assignment_summary.html" with current_doc_name=review_assignemnt.review_request.doc.name current_rev=review_assignment.reviewed_rev %} {% endfor %} | diff --git a/ietf/templates/doc/review_assignment_summary.html b/ietf/templates/doc/review_assignment_summary.html index e6e9bcca6..de4e82040 100644 --- a/ietf/templates/doc/review_assignment_summary.html +++ b/ietf/templates/doc/review_assignment_summary.html @@ -1,12 +1,12 @@
{{ w.doc_id }} | +{{ w.doc_id }} | {{ w.team.acronym }} |