Merged in changes from esanchez@yaco.es, changesets [3063],[3064],[3065],[3075],[3076],[3078] and [3085]. Fixes submission tool issues with wrong expected version for recently expired drafts, lacking announcement emails, too narrow date tolerance, and server state changes being possible through http GET, and more; with minor tweaks to setting names in settings.py.
- Legacy-Id: 3086 Note: SVN reference [3063] has been migrated to Git commitaf039fba02
Note: SVN reference [3064] has been migrated to Git commitfe466900e1
Note: SVN reference [3065] has been migrated to Git commitbe0f5e4962
Note: SVN reference [3075] has been migrated to Git commite0f4185c54
Note: SVN reference [3076] has been migrated to Git commitccfd8b5eed
Note: SVN reference [3078] has been migrated to Git commitfe699f7062
Note: SVN reference [3085] has been migrated to Git commit7fb27754f7
This commit is contained in:
commit
8b1138b447
|
@ -196,6 +196,8 @@ LIAISON_ATTACH_URL = '/documents/LIAISON/'
|
|||
# ID Submission Tool settings
|
||||
IDSUBMIT_FROM_EMAIL = 'IETF I-D Submission Tool <idsubmission@ietf.org>'
|
||||
IDSUBMIT_TO_EMAIL = 'internet-drafts@ietf.org'
|
||||
IDST_ID_EMAIL = 'Internet-Drafts@ietf.org'
|
||||
IDST_ID_ANNOUNCE_LIST = 'i-d-announce@ietf.org'
|
||||
|
||||
# Days from meeting to cut off dates on submit
|
||||
FIRST_CUTOFF_DAYS = 5
|
||||
|
|
|
@ -392,9 +392,8 @@ class MetaDataForm(AutoPostForm):
|
|||
if not creation_date:
|
||||
return None
|
||||
submit_date = self.draft.submission_date
|
||||
if creation_date > submit_date:
|
||||
raise forms.ValidationError('Creation Date must not be set after submission date')
|
||||
if creation_date + datetime.timedelta(days=3) < submit_date:
|
||||
if (creation_date + datetime.timedelta(days=3) < submit_date or
|
||||
creation_date - datetime.timedelta(days=3) > submit_date):
|
||||
raise forms.ValidationError('Creation Date must be within 3 days of submission date')
|
||||
return creation_date
|
||||
|
||||
|
@ -410,7 +409,7 @@ class MetaDataForm(AutoPostForm):
|
|||
raise forms.ValidationError('Version field is not in NN format')
|
||||
if version_int > 99 or version_int < 0:
|
||||
raise forms.ValidationError('Version must be set between 00 and 99')
|
||||
existing_revisions = [int(i.revision) for i in InternetDraft.objects.filter(filename=self.draft.filename)]
|
||||
existing_revisions = [int(i.revision_display()) for i in InternetDraft.objects.filter(filename=self.draft.filename)]
|
||||
expected = 0
|
||||
if existing_revisions:
|
||||
expected = max(existing_revisions) + 1
|
||||
|
|
|
@ -23,7 +23,7 @@ def show_two_pages(context, two_pages, validation):
|
|||
|
||||
@register.filter
|
||||
def two_pages_decorated_with_validation(value, validation):
|
||||
pages = value.first_two_pages
|
||||
pages = value.first_two_pages or ''
|
||||
if not 'revision' in validation.warnings.keys():
|
||||
return mark_safe('<pre class="twopages" style="display: none;">%s</pre>' % pages)
|
||||
result = '<pre class="twopages" style="display: none;">\n'
|
||||
|
|
|
@ -6,8 +6,9 @@ from django.conf import settings
|
|||
from django.contrib.sites.models import Site
|
||||
|
||||
from ietf.idtracker.models import (InternetDraft, PersonOrOrgInfo, IETFWG,
|
||||
IDAuthor, EmailAddress)
|
||||
IDAuthor, EmailAddress, IESGLogin)
|
||||
from ietf.utils.mail import send_mail
|
||||
from ietf.idrfc.utils import add_document_comment
|
||||
|
||||
|
||||
# Some usefull states
|
||||
|
@ -35,25 +36,34 @@ def request_full_url(request, submission):
|
|||
|
||||
def perform_post(submission):
|
||||
group_id = submission.group_acronym and submission.group_acronym.pk or NONE_WG
|
||||
state_change_msg = ''
|
||||
try:
|
||||
draft = InternetDraft.objects.get(filename=submission.filename)
|
||||
draft.title = submission.id_document_name
|
||||
draft.group_id = group_id
|
||||
draft.filename = submission.filename
|
||||
draft.revision = submission.revision
|
||||
draft.revision_date = submission.creation_date
|
||||
draft.revision_date = submission.submission_date
|
||||
draft.file_type = submission.file_type
|
||||
draft.txt_page_count = submission.txt_page_count
|
||||
draft.last_modified_date = datetime.date.today()
|
||||
draft.abstract = submission.abstract
|
||||
draft.status_id = 1 # Active
|
||||
draft.expired_tombstone = 0
|
||||
draft.save()
|
||||
if draft.idinternal and draft.idinternal.cur_sub_state_id == 5 and draft.idinternal.rfc_flag == 0: # Substate 5 Revised ID Needed
|
||||
draft.idinternal.prev_sub_state_id = draft.idinternal.cur_sub_state_id
|
||||
draft.idinternal.cur_sub_state_id = 2 # Substate 2 AD Followup
|
||||
draft.idinternal.save()
|
||||
state_change_msg = "Sub state has been changed to AD Follow up from New Id Needed"
|
||||
add_document_comment(None, draft, state_change_msg)
|
||||
except InternetDraft.DoesNotExist:
|
||||
draft = InternetDraft.objects.create(
|
||||
title=submission.id_document_name,
|
||||
group_id=group_id,
|
||||
filename=submission.filename,
|
||||
revision=submission.revision,
|
||||
revision_date=submission.creation_date,
|
||||
revision_date=submission.submission_date,
|
||||
file_type=submission.file_type,
|
||||
txt_page_count=submission.txt_page_count,
|
||||
start_date=datetime.date.today(),
|
||||
|
@ -63,11 +73,73 @@ def perform_post(submission):
|
|||
intended_status_id=8, # None
|
||||
)
|
||||
update_authors(draft, submission)
|
||||
add_document_comment(None, draft, "New version available")
|
||||
move_docs(submission)
|
||||
submission.status_id = POSTED
|
||||
send_announcements(submission, draft, state_change_msg)
|
||||
submission.save()
|
||||
|
||||
|
||||
def send_announcements(submission, draft, state_change_msg):
|
||||
announce_to_lists(submission)
|
||||
if draft.idinternal and not draft.idinternal.rfc_flag:
|
||||
announce_new_version(submission, draft, state_change_msg)
|
||||
announce_to_authors(submission)
|
||||
|
||||
|
||||
def announce_to_lists(submission):
|
||||
subject = 'I-D Action: %s-%s.txt' % (submission.filename, submission.revision)
|
||||
from_email = settings.IDST_ID_EMAIL
|
||||
to_email = [settings.IDST_ID_ANNOUNCE_LIST]
|
||||
authors = []
|
||||
for i in submission.tempidauthors_set.order_by('author_order'):
|
||||
if not i.author_order:
|
||||
continue
|
||||
authors.append(i.get_full_name())
|
||||
if submission.group_acronym:
|
||||
cc = [submission.group_acronym.email_address]
|
||||
else:
|
||||
cc = None
|
||||
send_mail(None, to_email, from_email, subject, 'submit/announce_to_lists.txt',
|
||||
{'submission': submission,
|
||||
'authors': authors}, cc=cc)
|
||||
|
||||
|
||||
def announce_new_version(submission, draft, state_change_msg):
|
||||
to_email = []
|
||||
if draft.idinternal.state_change_notice_to:
|
||||
to_email.append(draft.idinternal.state_change_notice_to)
|
||||
if draft.idinternal.job_owner:
|
||||
to_email.append(draft.idinternal.job_owner.person.email()[1])
|
||||
if draft.idinternal.ballot:
|
||||
for p in draft.idinternal.ballot.positions.all():
|
||||
if p.discuss == 1 and p.ad.user_level == IESGLogin.AD_LEVEL:
|
||||
to_email.append(p.ad.person.email()[1])
|
||||
subject = 'New Version Notification - %s-%s.txt' % (submission.filename, submission.revision)
|
||||
from_email = settings.IDST_ID_EMAIL
|
||||
send_mail(None, to_email, from_email, subject, 'submit/announce_new_version.txt',
|
||||
{'submission': submission,
|
||||
'msg': state_change_msg})
|
||||
|
||||
|
||||
def announce_to_authors(submission):
|
||||
authors = submission.tempidauthors_set.order_by('author_order')
|
||||
cc = list(set([i.email()[1] for i in authors]))
|
||||
to_email = [authors[0].email()[1]] # First TempIdAuthor is submitter
|
||||
from_email = settings.IDST_ID_EMAIL
|
||||
subject = 'New Version Notification for %s-%s.txt' % (submission.filename, submission.revision)
|
||||
if submission.group_acronym:
|
||||
wg = submission.group_acronym.group_acronym.acronym
|
||||
elif submission.filename.startswith('draft-iesg'):
|
||||
wg = 'IESG'
|
||||
else:
|
||||
wg = 'Individual Submission'
|
||||
send_mail(None, to_email, from_email, subject, 'submit/announce_to_authors.txt',
|
||||
{'submission': submission,
|
||||
'submitter': authors[0].get_full_name(),
|
||||
'wg': wg}, cc=cc)
|
||||
|
||||
|
||||
def find_person(first_name, last_name, middle_initial, name_suffix, email):
|
||||
person_list = None
|
||||
if email:
|
||||
|
@ -212,7 +284,7 @@ class DraftValidation(object):
|
|||
if self.draft.status_id in [POSTED, POSTED_BY_SECRETARIAT]:
|
||||
return
|
||||
revision = self.draft.revision
|
||||
existing_revisions = [int(i.revision) for i in InternetDraft.objects.filter(filename=self.draft.filename)]
|
||||
existing_revisions = [int(i.revision_display()) for i in InternetDraft.objects.filter(filename=self.draft.filename)]
|
||||
expected = 0
|
||||
if existing_revisions:
|
||||
expected = max(existing_revisions) + 1
|
||||
|
@ -233,9 +305,8 @@ class DraftValidation(object):
|
|||
self.add_warning('creation_date', 'Creation Date field is empty or the creation date is not in a proper format')
|
||||
return
|
||||
submit_date = self.draft.submission_date
|
||||
if date > submit_date:
|
||||
self.add_warning('creation_date', 'Creation Date must not be set after submission date')
|
||||
if date + datetime.timedelta(days=3) < submit_date:
|
||||
if (date + datetime.timedelta(days=3) < submit_date or
|
||||
date - datetime.timedelta(days=3) > submit_date):
|
||||
self.add_warning('creation_date', 'Creation Date must be within 3 days of submission date')
|
||||
|
||||
def get_authors(self):
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.contrib.sites.models import Site
|
||||
from django.http import HttpResponseRedirect, Http404, HttpResponseForbidden
|
||||
from django.http import HttpResponseRedirect, Http404, HttpResponseForbidden, HttpResponseNotAllowed
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.shortcuts import render_to_response
|
||||
from django.template import RequestContext
|
||||
|
@ -167,6 +167,8 @@ def draft_status(request, submission_id, submission_hash=None, message=None):
|
|||
|
||||
|
||||
def draft_cancel(request, submission_id, submission_hash=None):
|
||||
if request.method!='POST':
|
||||
return HttpResponseNotAllowed(['POST'])
|
||||
detail = get_object_or_404(IdSubmissionDetail, submission_id=submission_id)
|
||||
can_cancel = _can_cancel(request.user, detail, submission_hash)
|
||||
if not can_cancel:
|
||||
|
@ -212,12 +214,19 @@ def draft_confirm(request, submission_id, auth_key):
|
|||
elif detail.status_id != WAITING_AUTHENTICATION:
|
||||
message = ('error', 'The submission can not be autoposted because it is in state: %s' % detail.status.status_value)
|
||||
else:
|
||||
message = ('success', 'Authorization key accepted. Auto-Post complete')
|
||||
perform_post(detail)
|
||||
if request.method=='POST':
|
||||
message = ('success', 'Authorization key accepted. Auto-Post complete')
|
||||
perform_post(detail)
|
||||
else:
|
||||
return render_to_response('submit/last_confirmation_step.html',
|
||||
{'detail': detail, },
|
||||
context_instance=RequestContext(request))
|
||||
return draft_status(request, submission_id, message=message)
|
||||
|
||||
|
||||
def draft_approve(request, submission_id, check_function=_can_approve):
|
||||
if request.method!='POST':
|
||||
return HttpResponseNotAllowed(['POST'])
|
||||
detail = get_object_or_404(IdSubmissionDetail, submission_id=submission_id)
|
||||
can_perform = check_function(request.user, detail)
|
||||
if not can_perform:
|
||||
|
@ -229,10 +238,14 @@ def draft_approve(request, submission_id, check_function=_can_approve):
|
|||
|
||||
|
||||
def draft_force(request, submission_id):
|
||||
if request.method!='POST':
|
||||
return HttpResponseNotAllowed(['POST'])
|
||||
return draft_approve(request, submission_id, check_function=_can_force_post)
|
||||
|
||||
|
||||
def full_url_request(request, submission_id):
|
||||
if request.method!='POST':
|
||||
return HttpResponseNotAllowed(['POST'])
|
||||
detail = get_object_or_404(IdSubmissionDetail, submission_id=submission_id)
|
||||
request_full_url(request, detail)
|
||||
message = ('success', 'An email has been sent to draft authors to inform them of the full access url')
|
||||
|
|
8
ietf/templates/submit/announce_new_version.txt
Normal file
8
ietf/templates/submit/announce_new_version.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
New version (-{{ submission.revision }}) has been submitted for {{ submission.filename }}-{{ submission.revision }}.txt.
|
||||
http://www.ietf.org/internet-drafts/{{ submission.filename }}-{{ submission.revision }}.txt
|
||||
{{ msg }}
|
||||
|
||||
Diff from previous version:
|
||||
http://tools.ietf.org/rfcdiff?url2={{ submission.filename }}-{{ submission.revision }}
|
||||
|
||||
IETF Secretariat.
|
15
ietf/templates/submit/announce_to_authors.txt
Normal file
15
ietf/templates/submit/announce_to_authors.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
A new version of I-D, {{ submission.filename }}-{{ submission.revision }}.txt has been successfully submitted by {{ submitter }} and posted to the IETF repository.
|
||||
|
||||
Filename: {{ submission.filename }}
|
||||
Revision: {{ submission.revision }}
|
||||
Title: {{ submission.id_document_name }}
|
||||
Creation date: {{ submission.creation_date|date:"Y-m-d" }}
|
||||
WG ID: {{ wg }}
|
||||
Number of pages: {{ submission.txt_page_count }}
|
||||
|
||||
Abstract:
|
||||
{{ submission.abstract }}
|
||||
|
||||
{{ submission.comment_to_sec|default:"" }}
|
||||
|
||||
The IETF Secretariat
|
19
ietf/templates/submit/announce_to_lists.txt
Normal file
19
ietf/templates/submit/announce_to_lists.txt
Normal file
|
@ -0,0 +1,19 @@
|
|||
A New Internet-Draft is available from the on-line Internet-Drafts directories.{% if submission.group_acronym %} This draft is a work item of the {{ submission.group_acronym.group_acronym.name }} Working Group of the IETF.{% endif %}
|
||||
|
||||
Title : {{ submission.id_document_name }}
|
||||
Author(s) : {% for author in authors %}{{ author }}{% if not forloop.last %}
|
||||
{% endif %}{% endfor %}
|
||||
Filename : {{ submission.filename }}-{{ submission.revision }}.txt
|
||||
Pages : {{ submission.txt_page_count }}
|
||||
Date : {{ submission.submission_date|date:"Y-m-d" }}
|
||||
|
||||
{{ submission.abstract }}
|
||||
|
||||
A URL for this Internet-Draft is:
|
||||
http://www.ietf.org/internet-drafts/{{ submission.filename }}-{{ submission.revision }}.txt
|
||||
|
||||
Internet-Drafts are also available by anonymous FTP at:
|
||||
ftp://ftp.ietf.org/internet-drafts/
|
||||
|
||||
This Internet-Draft can be retrieved at:
|
||||
ftp://ftp.ietf.org/internet-drafts/{{ submission.filename }}-{{ submission.revision }}.txt
|
|
@ -24,12 +24,8 @@ pre.twopages { margin: 0px; }
|
|||
{% if can_cancel %}
|
||||
<script type="text/javascript">
|
||||
function confirmCancelation(){
|
||||
{% if is_valid %}if (confirm("Cancel this submission?")){% endif %}
|
||||
{% if submission_hash %}
|
||||
document.location = "{% url draft_cancel_by_hash detail.submission_id submission_hash %}";
|
||||
{% else %}
|
||||
document.location = "{% url draft_cancel detail.submission_id %}";
|
||||
{% endif %}
|
||||
{% if is_valid %}if (!confirm("Cancel this submission?")) return false;{% endif %}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
{% endif %}
|
||||
|
@ -198,7 +194,9 @@ returned to the submitter.
|
|||
{% if can_cancel %}
|
||||
<h2>Cancel submission</h2>
|
||||
<p>
|
||||
<input type="button" onclick="confirmCancelation();" value="Cancel Submission" /><br>
|
||||
<form method="post" onsubmit="return confirmCancelation();" action="{% url draft_cancel_by_hash detail.submission_id submission_hash %}">
|
||||
<input type="submit" value="Cancel Submission" /><br>
|
||||
</form>
|
||||
This submission will be canceled, and its uploaded document(s) permanently deleted.
|
||||
</p>
|
||||
{% endif %}
|
||||
|
|
15
ietf/templates/submit/last_confirmation_step.html
Normal file
15
ietf/templates/submit/last_confirmation_step.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% extends "submit/submit_base.html" %}
|
||||
|
||||
{% block title %}Confirm Auto-Post{% endblock %}
|
||||
|
||||
|
||||
{% block submit_content %}
|
||||
|
||||
<h2>Confirm auto-post</h2>
|
||||
<p>
|
||||
Authorization key accepted. Please the button below to finish Auto-Post of <strong>{{ detail.filename }}-{{ detail.revision }}</strong>
|
||||
</p>
|
||||
<form action="" method="post">
|
||||
<input type="submit" value="Auto-Post" />
|
||||
</form>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue