Undid the previous commit
- Legacy-Id: 16735
This commit is contained in:
parent
e3e9f676b7
commit
44f42cdb3a
17
changelog
17
changelog
|
@ -1,20 +1,3 @@
|
|||
ietfdb (6.101.1) ietf; urgency=medium
|
||||
|
||||
* Added a link from the datatracker RFC pages to the new RFC rendereings
|
||||
with inline errata on the RFC-Editor webpage (where available).
|
||||
|
||||
* Updated rfc-editor sync code to recognize the new Tooling Issue queue
|
||||
state.
|
||||
|
||||
* Updated ietf.sync.rfceditor.parse_index() to use the new rfc-index
|
||||
schema (changed placement of the page-count element).
|
||||
|
||||
* Added code to catch a form error regularly caused by form spam and
|
||||
return a failure instead of triggering a server 500.
|
||||
|
||||
-- Henrik Levkowetz <henrik@levkowetz.com> 15 Sep 2019 11:35:29 +0000
|
||||
|
||||
|
||||
ietfdb (6.101.0) ietf; urgency=medium
|
||||
|
||||
**IANA expert review tracking, new constraints labelling**
|
||||
|
|
|
@ -206,7 +206,7 @@ def document_main(request, name, rev=None):
|
|||
|
||||
# file types
|
||||
base_path = os.path.join(settings.RFC_PATH, name + ".")
|
||||
possible_types = settings.RFC_FILE_TYPES
|
||||
possible_types = ["txt", "pdf", "ps"]
|
||||
found_types = [t for t in possible_types if os.path.exists(base_path + t)]
|
||||
|
||||
base = "https://www.rfc-editor.org/rfc/"
|
||||
|
@ -220,7 +220,7 @@ def document_main(request, name, rev=None):
|
|||
file_urls.append(("pdf", base + "pdfrfc/" + name + ".txt.pdf"))
|
||||
|
||||
if "txt" in found_types:
|
||||
file_urls.append(("htmlized", settings.TOOLS_ID_HTML_URL + name))
|
||||
file_urls.append(("html", settings.TOOLS_ID_HTML_URL + name))
|
||||
if doc.tags.filter(slug="errata"):
|
||||
file_urls.append(("with errata", settings.RFC_EDITOR_INLINE_ERRATA_URL.format(rfc_number=rfc_number)))
|
||||
|
||||
|
@ -236,8 +236,8 @@ def document_main(request, name, rev=None):
|
|||
|
||||
# file types
|
||||
base_path = os.path.join(settings.INTERNET_DRAFT_PATH, doc.name + "-" + doc.rev + ".")
|
||||
possible_types = settings.IDSUBMIT_FILE_TYPES
|
||||
found_types = [t for t in possible_types if os.path.exists(base_path + t)]
|
||||
possible_types = ["pdf", "xml", "ps"]
|
||||
found_types = ["txt"] + [t for t in possible_types if os.path.exists(base_path + t)]
|
||||
|
||||
if not snapshot and doc.get_state_slug() == "active":
|
||||
base = settings.IETF_ID_URL
|
||||
|
@ -251,7 +251,7 @@ def document_main(request, name, rev=None):
|
|||
|
||||
if "pdf" not in found_types:
|
||||
file_urls.append(("pdf", settings.TOOLS_ID_PDF_URL + doc.name + "-" + doc.rev + ".pdf"))
|
||||
file_urls.append(("htmlized", settings.TOOLS_ID_HTML_URL + doc.name + "-" + doc.rev))
|
||||
file_urls.append(("html", settings.TOOLS_ID_HTML_URL + doc.name + "-" + doc.rev))
|
||||
|
||||
# latest revision
|
||||
latest_revision = doc.latest_event(NewRevisionDocEvent, type="new_revision")
|
||||
|
|
|
@ -780,20 +780,15 @@ IDSUBMIT_CHECKER_CLASSES = (
|
|||
|
||||
IDSUBMIT_MANUAL_STAGING_DIR = '/tmp/'
|
||||
|
||||
|
||||
IDSUBMIT_FILE_TYPES = (
|
||||
'txt',
|
||||
'html',
|
||||
'xml',
|
||||
'pdf',
|
||||
'ps',
|
||||
)
|
||||
RFC_FILE_TYPES = IDSUBMIT_FILE_TYPES
|
||||
|
||||
IDSUBMIT_MAX_DRAFT_SIZE = {
|
||||
'txt': 2*1024*1024, # Max size of txt draft file in bytes
|
||||
'xml': 3*1024*1024, # Max size of xml draft file in bytes
|
||||
'html': 4*1024*1024,
|
||||
'pdf': 6*1024*1024,
|
||||
'ps' : 6*1024*1024,
|
||||
}
|
||||
|
|
|
@ -352,15 +352,12 @@ class SubmissionBaseUploadForm(forms.Form):
|
|||
class SubmissionManualUploadForm(SubmissionBaseUploadForm):
|
||||
xml = forms.FileField(label='.xml format', required=False) # xml field with required=False instead of True
|
||||
txt = forms.FileField(label='.txt format', required=False)
|
||||
# We won't permit html upload until we can verify that the content
|
||||
# reasonably matches the text and/or xml upload:
|
||||
# html = forms.FileField(label='.html format', required=False)
|
||||
pdf = forms.FileField(label='.pdf format', required=False)
|
||||
ps = forms.FileField(label='.ps format', required=False)
|
||||
|
||||
def __init__(self, request, *args, **kwargs):
|
||||
super(SubmissionManualUploadForm, self).__init__(request, *args, **kwargs)
|
||||
self.formats = settings.IDSUBMIT_FILE_TYPES
|
||||
self.formats = ['txt', 'pdf', 'xml', 'ps', ]
|
||||
self.base_formats = ['txt', 'xml', ]
|
||||
|
||||
def clean_txt(self):
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" []>
|
||||
<?rfc toc="yes"?>
|
||||
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="info" docName="%(name)s" ipr="trust200902" obsoletes="" updates="" submissionType="IETF" xml:lang="en" version="3">
|
||||
<!-- xml2rfc v2v3 conversion 2.29.1 -->
|
||||
<rfc category="info" docName="%(name)s" ipr="trust200902">
|
||||
<front>
|
||||
<title>%(title)s</title>
|
||||
<seriesInfo name="Internet-Draft" value="%(name)s"/>
|
||||
<author fullname="%(author)s" initials="%(initials)s" surname="%(surname)s">
|
||||
<organization>Test Centre Inc.</organization>
|
||||
|
||||
<address>
|
||||
<postal>
|
||||
<street>42 Some Road</street>
|
||||
|
@ -17,7 +16,7 @@
|
|||
<email>%(email)s</email>
|
||||
</address>
|
||||
</author>
|
||||
<date day="%(day)s" month="%(month)s" year="%(year)s"/>
|
||||
<date month="%(month)s" year="%(year)s" />
|
||||
<workgroup>%(group)s</workgroup>
|
||||
<abstract>
|
||||
<t>
|
||||
|
@ -25,16 +24,18 @@
|
|||
</t>
|
||||
</abstract>
|
||||
</front>
|
||||
|
||||
<middle>
|
||||
<section numbered="true" toc="default">
|
||||
<name>Introduction</name>
|
||||
<section title="Introduction">
|
||||
<t>
|
||||
This document describes a protocol for testing tests.
|
||||
</t>
|
||||
</section>
|
||||
<section numbered="true" toc="default">
|
||||
<name>Yang</name>
|
||||
<sourcecode name="ietf-yang-metadata@2016-08-05.yang" type="" markers="true"><![CDATA[
|
||||
<section title="Yang">
|
||||
<figure>
|
||||
<artwork>
|
||||
<![CDATA[
|
||||
<CODE BEGINS> file "ietf-yang-metadata@2016-08-05.yang"
|
||||
|
||||
module ietf-yang-metadata {
|
||||
|
||||
|
@ -121,10 +122,13 @@ module ietf-yang-metadata {
|
|||
}
|
||||
}
|
||||
|
||||
]]></sourcecode>
|
||||
<CODE ENDS>
|
||||
]]>
|
||||
</artwork>
|
||||
</figure>
|
||||
</section>
|
||||
<section anchor="JSON" numbered="true" toc="default">
|
||||
<name>JSON example</name>
|
||||
|
||||
<section anchor="JSON" title="JSON example">
|
||||
<t>
|
||||
The JSON object should look like this:
|
||||
|
||||
|
@ -133,18 +137,17 @@ module ietf-yang-metadata {
|
|||
}
|
||||
</t>
|
||||
</section>
|
||||
<section anchor="Security" numbered="true" toc="default">
|
||||
<name>Security Considerations</name>
|
||||
<section anchor="Security" title="Security Considerations">
|
||||
<t>
|
||||
There are none.
|
||||
</t>
|
||||
</section>
|
||||
<section anchor="IANA" numbered="true" toc="default">
|
||||
<name>IANA Considerations</name>
|
||||
<section anchor="IANA" title="IANA Considerations">
|
||||
<t>
|
||||
No new registrations for IANA.
|
||||
</t>
|
||||
</section>
|
||||
</middle>
|
||||
<back/>
|
||||
<back>
|
||||
</back>
|
||||
</rfc>
|
||||
|
|
|
@ -64,7 +64,6 @@ def submission_file(name, rev, group, format, templatename, author=None, email=N
|
|||
expiration=(datetime.date.today() + datetime.timedelta(days=100)).strftime("%d %B, %Y"),
|
||||
year=year,
|
||||
month=datetime.date.today().strftime("%B"),
|
||||
day=datetime.date.today().strftime("%d"),
|
||||
name="%s-%s" % (name, rev),
|
||||
group=group or "",
|
||||
author=author.ascii if ascii else author.name,
|
||||
|
@ -152,8 +151,6 @@ class SubmitTests(TestCase):
|
|||
status_url = r["Location"]
|
||||
for format in formats:
|
||||
self.assertTrue(os.path.exists(os.path.join(self.staging_dir, "%s-%s.%s" % (name, rev, format))))
|
||||
if format == 'xml':
|
||||
self.assertTrue(os.path.exists(os.path.join(self.staging_dir, "%s-%s.%s" % (name, rev, 'html'))))
|
||||
self.assertEqual(Submission.objects.filter(name=name).count(), 1)
|
||||
submission = Submission.objects.get(name=name)
|
||||
if len(submission.authors) != 1:
|
||||
|
@ -1687,7 +1684,7 @@ class ApiSubmitTests(TestCase):
|
|||
self.assertContains(r, expected, status_code=400)
|
||||
|
||||
def test_api_submit_failed_idnits(self):
|
||||
r, author, name = self.post_submission('00', year="2010")
|
||||
r, author, name = self.post_submission('00', year="1900")
|
||||
expected = "Document date must be within 3 days of submission date"
|
||||
self.assertContains(r, expected, status_code=400)
|
||||
|
||||
|
|
|
@ -528,14 +528,16 @@ def cancel_submission(submission):
|
|||
remove_submission_files(submission)
|
||||
|
||||
def rename_submission_files(submission, prev_rev, new_rev):
|
||||
for ext in settings.IDSUBMIT_FILE_TYPES:
|
||||
from ietf.submit.forms import SubmissionManualUploadForm
|
||||
for ext in list(SubmissionManualUploadForm.base_fields.keys()):
|
||||
source = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.%s' % (submission.name, prev_rev, ext))
|
||||
dest = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.%s' % (submission.name, new_rev, ext))
|
||||
if os.path.exists(source):
|
||||
os.rename(source, dest)
|
||||
|
||||
def move_files_to_repository(submission):
|
||||
for ext in settings.IDSUBMIT_FILE_TYPES:
|
||||
from ietf.submit.forms import SubmissionManualUploadForm
|
||||
for ext in list(SubmissionManualUploadForm.base_fields.keys()):
|
||||
source = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.%s' % (submission.name, submission.rev, ext))
|
||||
dest = os.path.join(settings.IDSUBMIT_REPOSITORY_PATH, '%s-%s.%s' % (submission.name, submission.rev, ext))
|
||||
if os.path.exists(source):
|
||||
|
@ -621,21 +623,17 @@ def get_draft_meta(form, saved_files):
|
|||
abstract = None
|
||||
file_size = None
|
||||
if form.cleaned_data['xml']:
|
||||
try:
|
||||
xmlroot = form.xmltree.getroot()
|
||||
xml_version = xmlroot.get('version', '2')
|
||||
if xml_version == '3':
|
||||
prep = xml2rfc.PrepToolWriter(form.xmltree, quiet=True)
|
||||
form.xmltree.tree = prep.prep()
|
||||
except Exception as e:
|
||||
raise ValidationError("Error from xml2rfc: %s" % e)
|
||||
if not ('txt' in form.cleaned_data and form.cleaned_data['txt']):
|
||||
file_name['txt'] = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.txt' % (form.filename, form.revision))
|
||||
try:
|
||||
xmlroot = form.xmltree.getroot()
|
||||
xml_version = xmlroot.get('version', '2')
|
||||
if xml_version != '3':
|
||||
pagedwriter = xml2rfc.PaginatedTextRfcWriter(form.xmltree, quiet=True)
|
||||
pagedwriter.write(file_name['txt'])
|
||||
else:
|
||||
prep = xml2rfc.PrepToolWriter(form.xmltree, quiet=True)
|
||||
form.xmltree.tree = prep.prep()
|
||||
writer = xml2rfc.TextWriter(form.xmltree, quiet=True)
|
||||
writer.write(file_name['txt'])
|
||||
log.log("In %s: xml2rfc %s generated %s from %s (version %s)" %
|
||||
|
@ -647,20 +645,6 @@ def get_draft_meta(form, saved_files):
|
|||
except Exception as e:
|
||||
raise ValidationError("Error from xml2rfc: %s" % e)
|
||||
file_size = os.stat(file_name['txt']).st_size
|
||||
try:
|
||||
if xml_version == '3':
|
||||
file_name['html'] = os.path.join(settings.IDSUBMIT_STAGING_PATH, '%s-%s.html' % (form.filename, form.revision))
|
||||
writer = xml2rfc.HtmlWriter(form.xmltree, quiet=True)
|
||||
writer.write(file_name['html'])
|
||||
form.file_types.append('.html')
|
||||
log.log("In %s: xml2rfc %s generated %s from %s (version %s)" %
|
||||
( os.path.dirname(file_name['xml']),
|
||||
xml2rfc.__version__,
|
||||
os.path.basename(file_name['html']),
|
||||
os.path.basename(file_name['xml']),
|
||||
xml_version))
|
||||
except Exception as e:
|
||||
raise ValidationError("Error from xml2rfc: %s" % e)
|
||||
# Some meta-information, such as the page-count, can only
|
||||
# be retrieved from the generated text file. Provide a
|
||||
# parsed draft object to get at that kind of information.
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
{% show_submission_files submission %}
|
||||
|
||||
{% if errors.files %}
|
||||
<p class="text-danger bg-danger"><b>{{ errors.files|safe }}</b></p>
|
||||
<p class="text-danger"><b>{{ errors.files|safe }}</b></p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -164,7 +164,7 @@
|
|||
|
||||
{% if errors.rev %}
|
||||
<button class="btn btn-default btn-xs pull-right" data-toggle="modal" data-target="#twopages">View errors in document</button>
|
||||
<p class="text-danger bg-danger"><b>{{ errors.rev }}</b></p>
|
||||
<p class="text-danger"><b>{{ errors.rev }}</b></p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -174,7 +174,7 @@
|
|||
<td>
|
||||
{{ submission.group|default:"Individual Submission" }}
|
||||
{% if errors.group %}
|
||||
<p class="text-danger bg-danger"><b>{{ errors.group }}</b></p>
|
||||
<p class="text-danger"><b>{{ errors.group }}</b></p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -184,7 +184,7 @@
|
|||
<td>
|
||||
{{ submission.document_date }}
|
||||
{% if errors.document_date %}
|
||||
<p class="text-danger bg-danger"><b>{{ errors.document_date }}</b></p>
|
||||
<p class="text-danger"><b>{{ errors.document_date }}</b></p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -198,7 +198,7 @@
|
|||
<th>Title</th>
|
||||
<td>
|
||||
{{ submission.title|default:"" }}
|
||||
{% if errors.title %}<p class="text-danger bg-danger"><b>{{ errors.title }}</b></p>{% endif %}
|
||||
{% if errors.title %}<p class="text-danger"><b>{{ errors.title }}</b></p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -206,7 +206,7 @@
|
|||
<th>Authors</th>
|
||||
<td>
|
||||
{{ submission.authors|length }} author{{ submission.authors|pluralize }}
|
||||
{% if errors.authors %}<p class="text-danger bg-danger"><b>{{ errors.authors|safe }}</b></p>{% endif %}
|
||||
{% if errors.authors %}<p class="text-danger"><b>{{ errors.authors|safe }}</b></p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -244,7 +244,7 @@
|
|||
<th>Abstract</th>
|
||||
<td>
|
||||
{{ submission.abstract|linebreaksbr }}
|
||||
{% if errors.abstract %}<p class="text-danger bg-danger"><b>{{ errors.abstract }}</b></p>{% endif %}
|
||||
{% if errors.abstract %}<p class="text-danger"><b>{{ errors.abstract }}</b></p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -252,7 +252,7 @@
|
|||
<th>Pages</th>
|
||||
<td>
|
||||
{{ submission.pages }}
|
||||
{% if errors.pages %}<p class="text-danger bg-danger"><b>{{ errors.pages }}</b></p>{% endif %}
|
||||
{% if errors.pages %}<p class="text-danger"><b>{{ errors.pages }}</b></p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -265,7 +265,7 @@
|
|||
<th>Formal languages used</th>
|
||||
<td>
|
||||
{% for l in submission.formal_languages.all %}{{ l.name }}{% if not forloop.last %}, {% endif %}{% empty %}None recognized{% endfor %}
|
||||
{% if errors.formal_languages %}<p class="text-danger bg-danger"><b>{{ errors.formal_languages }}</b></p>{% endif %}
|
||||
{% if errors.formal_languages %}<p class="text-danger"><b>{{ errors.formal_languages }}</b></p>{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue