Skip to content

Commit f6a1fcd

Browse files
committed
Added more information about submission errors and a full idnits run to the manual post email sent to the secretariat.
- Legacy-Id: 12831
1 parent 60da61b commit f6a1fcd

3 files changed

Lines changed: 31 additions & 3 deletions

File tree

ietf/submit/checkers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ class DraftIdnitsChecker(object):
4949
# symbol = '<span class="fa fa-check-square"></span>'
5050
symbol = ""
5151

52+
def __init__(self, options=["--submitcheck", "--nitcount", ]):
53+
assert isinstance(options, list)
54+
if not "--nitcount" in options:
55+
options.append("--nitcount")
56+
self.options = ' '.join(options)
57+
5258
def check_file_txt(self, path):
5359
"""
5460
Run an idnits check, and return a passed/failed indication, a message,
@@ -66,7 +72,7 @@ def check_file_txt(self, path):
6672
warnstart = [' == ', ' -- ']
6773

6874

69-
cmd = "%s --submitcheck --nitcount %s" % (settings.IDSUBMIT_IDNITS_BINARY, path)
75+
cmd = "%s %s %s" % (settings.IDSUBMIT_IDNITS_BINARY, self.options, path)
7076
code, out, err = pipe(cmd)
7177
if code != 0 or out == "":
7278
message = "idnits error: %s:\n Error %s: %s" %( cmd, code, err)

ietf/submit/mail.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
from django.contrib.sites.models import Site
1212
from django.template.loader import render_to_string
1313

14+
import debug # pyflakes:ignore
15+
1416
from ietf.utils.log import log
1517
from ietf.utils.mail import send_mail, send_mail_message
1618
from ietf.doc.models import Document
@@ -20,6 +22,7 @@
2022
from ietf.utils.accesstoken import generate_access_token
2123
from ietf.mailtrigger.utils import gather_address_lists, get_base_submission_message_address
2224
from ietf.submit.models import SubmissionEmailEvent, Submission
25+
from ietf.submit.checkers import DraftIdnitsChecker
2326

2427
def send_submission_confirmation(request, submission, chair_notice=False):
2528
subject = 'Confirm submission of I-D %s' % submission.name
@@ -80,10 +83,14 @@ def send_manual_post_request(request, submission, errors):
8083
subject = u'Manual Post Requested for %s' % submission.name
8184
from_email = settings.IDSUBMIT_FROM_EMAIL
8285
(to_email,cc) = gather_address_lists('sub_manual_post_requested',submission=submission)
86+
checker = DraftIdnitsChecker(options=[]) # don't use the default --submitcheck limitation
87+
file_name = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.txt' % (submission.name, submission.rev))
88+
nitspass, nitsmsg, nitserr, nitswarn, nitsresult = checker.check_file_txt(file_name)
8389
send_mail(request, to_email, from_email, subject, 'submit/manual_post_request.txt', {
8490
'submission': submission,
8591
'url': settings.IDTRACKER_BASE_URL + urlreverse('ietf.submit.views.submission_status', kwargs=dict(submission_id=submission.pk)),
8692
'errors': errors,
93+
'idnits': nitsmsg,
8794
}, cc=cc)
8895

8996

ietf/templates/submit/manual_post_request.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
{% autoescape off %}
22
Hi,
33

4-
Manual posting has been requested for the following Internet-Draft:
4+
Manual posting has been requested for the following Internet-Draft.
5+
6+
{% if errors %}The problems found during automated submission were: {% for err in errors.values %}
7+
- {{ err }}{% endfor %}
8+
9+
If the authors claim that this is incorrect, then please look at the actual
10+
draft and verify that it does not have the problems indicated.
11+
{% endif %}
12+
Full idnits results are available at the end of this message.
513

614
I-D Submission Tool URL:
715
{{ url }}
@@ -18,7 +26,8 @@ I-D Submission Tool URL:
1826

1927
Submitter : {{ submission.submitter }}
2028

21-
Abstract : {{ submission.abstract }}
29+
Abstract :
30+
{{ submission.abstract }}
2231

2332

2433
Authors:
@@ -28,4 +37,10 @@ I-D Submission Tool URL:
2837
Comment to the secretariat:
2938

3039
{{ submission.note }}
40+
41+
42+
Idnits result:
43+
44+
{{ idnits }}
45+
3146
{% endautoescape %}

0 commit comments

Comments
 (0)