File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # -*- coding: utf-8 -*-
1+ # -*- coding: utf-8 -*-
22from __future__ import unicode_literals
33
4+ from tqdm import tqdm
45from django .db import migrations
56
67def populate_submission_draft (apps , schema_editor ):
78 Submission = apps .get_model ('submit' , 'Submission' )
89 Document = apps .get_model ('doc' , 'Document' )
910 print ("" )
10- for submission in Submission .objects .filter (state_id = 'posted' ):
11- if submission .draft == None :
12- try :
13- draft = Document .objects .get (name = submission .name )
14- except Document .DoesNotExist :
15- print ( "Failed to find %s-%s" % (submission .name , submission .rev ))
16- continue
17- submission .draft = draft
18- submission .save ()
11+ submissions = Submission .objects .filter (state_id = 'posted' , draft = None )
12+ count = submissions .count ()
13+ print (" Fixing up draft information for %s submissions" % count )
14+ for submission in tqdm (submissions ):
15+ try :
16+ draft = Document .objects .get (name = submission .name )
17+ except Document .DoesNotExist :
18+ print ( " Failed to find %s-%s" % (submission .name , submission .rev ))
19+ continue
20+ submission .draft = draft
21+ submission .save ()
1922
2023def backward (apps , schema_editor ):
2124 pass # nothing to do
Original file line number Diff line number Diff line change 1- # -*- coding: utf-8 -*-
1+ # -*- coding: utf-8 -*-
22from __future__ import unicode_literals
33
4+ from tqdm import tqdm
45from django .db import migrations
56from ietf .submit .checkers import DraftIdnitsChecker , DraftYangChecker
67
78def set_submission_check_symbol (apps , schema_editor ):
89 SubmissionCheck = apps .get_model ('submit' ,'SubmissionCheck' )
9- for s in SubmissionCheck .objects .all ():
10+ checks = SubmissionCheck .objects .all ()
11+ print ("" )
12+ print (" Adding submission check symbol info to existing checks" )
13+ for s in tqdm ():
1014 if not s .symbol :
1115 if s .checker == "idnits check" :
1216 s .symbol = DraftIdnitsChecker .symbol
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ python-magic>=0.4.6
2727python-memcached >= 1.48 # for django.core.cache.backends.memcached
2828pytz >= 2014.7
2929six >= 1.8.0
30+ tqdm >= 3.5.0
3031Unidecode >= 0.4.18
3132#wsgiref>=0.1.2
3233xml2rfc >= 2.5.
You can’t perform that action at this time.
0 commit comments