Skip to content

Commit 54a774c

Browse files
committed
Robustness improvements for the bluesheet migrations. Commit ready to merge.
- Legacy-Id: 11779
1 parent 0611444 commit 54a774c

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

ietf/meeting/migrations/0032_reconstruct_bluesheet_docs_95through96.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import os
55

6+
import debug # pyflakes:ignore
7+
68
from django.db import migrations
79
from django.conf import settings
810

@@ -19,12 +21,18 @@ def forward(apps, schema_editor):
1921

2022
active = State.objects.get(type_id='bluesheets',slug='active')
2123

24+
print
25+
print "Attention: The following anomalies are expected:"
26+
print "There are no bluesheets for nmlrg at IETF95 or for cellar at IETF96."
27+
print "At IETF95, netmod and opsec have a different number of bluesheets than sessions."
28+
print "Please report any other warnings issued during the production migration to RjS."
29+
2230
for num in [95, 96]:
2331
mtg = Meeting.objects.get(number=num)
2432
bs_path = '%s/bluesheets/'% os.path.join(settings.AGENDA_PATH,mtg.number)
2533
bs_files = os.listdir(bs_path)
26-
bs_acronyms = set([x[14:-7] for x in bs_files])
27-
group_acronyms = set([x.group.acronym for x in mtg.session_set.all() if official_time(x) and x.group.type_id in ['wg','rg','ag'] and not x.agenda_note.lower().startswith('cancel')])
34+
bs_acronyms = set([x[14:].split('-')[0] for x in bs_files])
35+
group_acronyms = set([x.group.acronym for x in mtg.session_set.filter(status_id='sched') if official_time(x) and x.group.type_id in ['wg','rg','ag'] and not x.agenda_note.lower().startswith('cancel')])
2836

2937
if bs_acronyms-group_acronyms:
3038
print "Warning IETF%s : groups that have bluesheets but did not appear to meet: %s"%(num,list(bs_acronyms-group_acronyms))
@@ -57,7 +65,7 @@ def forward(apps, schema_editor):
5765

5866
def reverse(apps, schema_editor):
5967
Document = apps.get_model('doc','Document')
60-
Document.objects.filter(type_id='bluesheets',sessionpresentation__session__meeting__number_in=[95,96]).exclude(group__acronym='openpgp').delete()
68+
Document.objects.filter(type_id='bluesheets',sessionpresentation__session__meeting__number__in=[95,96]).exclude(group__acronym='openpgp').delete()
6169

6270
class Migration(migrations.Migration):
6371

0 commit comments

Comments
 (0)