Skip to content

Commit c486ec8

Browse files
committed
Fixed naming of staged xml draft submission files and tweaked the arguments for the xml2rfc parser invocation for xml draft submissions. Added some more logging.
- Legacy-Id: 17075
1 parent a0c2bf1 commit c486ec8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ietf/submit/forms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def format_messages(where, e, log):
182182
# --- Parse the xml ---
183183
try:
184184
parser = xml2rfc.XmlRfcParser(str(tfn), quiet=True)
185-
self.xmltree = parser.parse(remove_comments=False, quiet=True, add_xmlns=True)
185+
self.xmltree = parser.parse(remove_comments=False, quiet=True)
186186
self.xmlroot = self.xmltree.getroot()
187187
xml_version = self.xmlroot.get('version', '2')
188188
except Exception as e:
@@ -221,7 +221,7 @@ def format_messages(where, e, log):
221221
self.authors.append(info)
222222

223223
# --- Prep the xml ---
224-
file_name['xml'] = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.%s' % (self.filename, self.revision, ext))
224+
file_name['xml'] = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s%s' % (self.filename, self.revision, ext))
225225
try:
226226
if xml_version == '3':
227227
prep = xml2rfc.PrepToolWriter(self.xmltree, quiet=True, liberal=True, keep_pis=[xml2rfc.V3_PI_TARGET])
@@ -252,6 +252,7 @@ def format_messages(where, e, log):
252252
xml_version))
253253
except Exception as e:
254254
msgs = format_messages('txt', e, xml2rfc.log)
255+
log.log('\n'.join(msgs))
255256
raise forms.ValidationError(msgs)
256257

257258
# --- Convert to xml ---
@@ -290,7 +291,6 @@ def format_messages(where, e, log):
290291
[ forms.ValidationError("One or more XML validation errors occurred when processing the XML file:") ] +
291292
[ forms.ValidationError("%s: Line %s: %s" % (xml_file.name, r.line, r.message), code="%s"%r.type) for r in errors ]
292293
)
293-
294294
finally:
295295
os.close(tfh)
296296
os.unlink(tfn)

0 commit comments

Comments
 (0)