Skip to content

Commit 04c4043

Browse files
committed
allowing submissions to be canceled. Closes ietf-tools#591.
- Legacy-Id: 2846
1 parent 7c79a4d commit 04c4043

5 files changed

Lines changed: 58 additions & 51 deletions

File tree

ietf/submit/models.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,28 @@ class IdSubmissionDetail(models.Model):
1616
temp_id_document_tag = models.IntegerField(null=True, blank=True)
1717
status = models.ForeignKey(IdSubmissionStatus, db_column='status_id', null=True, blank=True)
1818
last_updated_date = models.DateField(null=True, blank=True)
19-
last_updated_time = models.CharField(blank=True, max_length=25)
20-
id_document_name = models.CharField(blank=True, max_length=255)
19+
last_updated_time = models.CharField(null=True, blank=True, max_length=25)
20+
id_document_name = models.CharField(null=True, blank=True, max_length=255)
2121
group_acronym = models.ForeignKey(IETFWG, null=True, blank=True)
22-
filename = models.CharField(blank=True, max_length=255)
22+
filename = models.CharField(null=True, blank=True, max_length=255)
2323
creation_date = models.DateField(null=True, blank=True)
2424
submission_date = models.DateField(null=True, blank=True)
25-
remote_ip = models.CharField(blank=True, max_length=100)
26-
revision = models.CharField(blank=True, max_length=3)
25+
remote_ip = models.CharField(null=True, blank=True, max_length=100)
26+
revision = models.CharField(null=True, blank=True, max_length=3)
2727
submitter_tag = models.IntegerField(null=True, blank=True)
28-
auth_key = models.CharField(blank=True, max_length=255)
29-
idnits_message = models.TextField(blank=True)
30-
file_type = models.CharField(blank=True, max_length=50)
31-
comment_to_sec = models.TextField(blank=True)
32-
abstract = models.TextField(blank=True)
28+
auth_key = models.CharField(null=True, blank=True, max_length=255)
29+
idnits_message = models.TextField(null=True, blank=True)
30+
file_type = models.CharField(null=True, blank=True, max_length=50)
31+
comment_to_sec = models.TextField(null=True, blank=True)
32+
abstract = models.TextField(null=True, blank=True)
3333
txt_page_count = models.IntegerField(null=True, blank=True)
34-
error_message = models.CharField(blank=True, max_length=255)
35-
warning_message = models.TextField(blank=True)
34+
error_message = models.CharField(null=True, blank=True, max_length=255)
35+
warning_message = models.TextField(null=True, blank=True)
3636
wg_submission = models.IntegerField(null=True, blank=True)
3737
filesize = models.IntegerField(null=True, blank=True)
3838
man_posted_date = models.DateField(null=True, blank=True)
39-
man_posted_by = models.CharField(blank=True, max_length=255)
40-
first_two_pages = models.TextField(blank=True)
39+
man_posted_by = models.CharField(null=True, blank=True, max_length=255)
40+
first_two_pages = models.TextField(null=True, blank=True)
4141
sub_email_priority = models.IntegerField(null=True, blank=True)
4242
invalid_version = models.IntegerField(null=True, blank=True)
4343
idnits_failed = models.IntegerField(null=True, blank=True)

ietf/submit/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
url(r'^status/$', 'submit_status', name='submit_status'),
77
url(r'^status/(?P<submission_id>\d+)/$', 'draft_status', name='draft_status'),
88
url(r'^status/(?P<submission_id>\d+)/edit/$', 'draft_edit', name='draft_edit'),
9-
url(r'^status/(?P<submission_id>\d+)/confirm/(?P<auth_key>[a-f\d]+)/$', 'draft_confirm', name='draft_confirm'),
9+
url(r'^status/(?P<submission_id>\d+)/cancel/$', 'draft_cancel', name='draft_cancel'),
1010
)
1111

1212
urlpatterns += patterns('django.views.generic.simple',

ietf/submit/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
MANUAL_POST_REQUESTED = 5
1212
POSTED = -1
1313
POSTED_BY_SECRETARIAT = -2
14+
CANCELED = -4
1415

1516

1617
# Not a real WG

ietf/submit/views.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from ietf.submit.models import IdSubmissionDetail
99
from ietf.submit.forms import UploadForm, AutoPostForm, MetaDataForm
10-
from ietf.submit.utils import (DraftValidation, UPLOADED, WAITING_AUTHENTICATION,
10+
from ietf.submit.utils import (DraftValidation, UPLOADED, WAITING_AUTHENTICATION, CANCELED,
1111
perform_post)
1212

1313

@@ -67,13 +67,18 @@ def draft_status(request, submission_id, message=None):
6767
'validation': validation,
6868
'auto_post_form': auto_post_form,
6969
'is_valid': is_valid,
70-
'status': status,
71-
'allow_edit': allow_edit,
72-
'message': message,
70+
'canceled': detail.status_id == CANCELED
7371
},
7472
context_instance=RequestContext(request))
7573

7674

75+
def draft_cancel(request, submission_id):
76+
detail = get_object_or_404(IdSubmissionDetail, submission_id=submission_id)
77+
detail.status_id = CANCELED
78+
detail.save()
79+
return HttpResponseRedirect(reverse(draft_status, None, kwargs={'submission_id': submission_id}))
80+
81+
7782
def draft_edit(request, submission_id):
7883
detail = get_object_or_404(IdSubmissionDetail, submission_id=submission_id)
7984
if detail.status_id != UPLOADED:

ietf/templates/submit/draft_status.html

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
{% block pagehead %}
2121
<script type="text/javascript" src="/js/lib/jquery-1.4.2.min.js"></script>
2222
<script type="text/javascript">
23+
function confirmCancelation(){
24+
if (confirm("Cancel this submission?"))
25+
document.location = "cancel";
26+
}
27+
2328
(function ($) {
2429

2530
$(document).ready(function () {
@@ -62,12 +67,12 @@
6267
{% endblock %}
6368

6469
{% block submit_content %}
65-
{% if status %}
66-
<h2>Status of the submission: {{ status.status_value }}</h2>
67-
{% endif %}
6870

69-
{% if message %}
70-
<div class="info-message-{{ message.0 }}">{{ message.1 }}</div>
71+
{% if canceled %}
72+
<h2>Submission Canceled</h2>
73+
<div class="metadata-errors">
74+
<p>This submission has been canceled, modification is no longer possible.</p>
75+
</div>
7176
{% endif %}
7277

7378
<h2>Check Page</h2>
@@ -138,33 +143,29 @@ <h3>Meta-Data errors found</h3>
138143
<tr{% if validation.warnings.pages %} class="warning"{% endif %}><th>Pages</th><td>{{ detail.txt_page_count }}<div class="warn_message">{{ validation.warnings.pages }}</div></td></tr>
139144
<tr{% if validation.warnings.abstract %} class="warning"{% endif %}><th>Abstract</th><td>{{ detail.abstract|linebreaksbr }}<div class="warn_message">{{ validation.warnings.abstract }}</div></td></tr>
140145
</table>
141-
142-
{% if validation.submitter %}
143-
<h3>Submitter information</h3>
144-
<table class="metadata-table">
145-
<tr><th>First name</th><td>{{ validation.submitter.first_name }}</td></tr>
146-
<tr><th>Last name</th><td>{{ validation.submitter.last_name }}</td></tr>
147-
<tr><th>Email addres</th><td>{{ validation.submitter.email_address }}</td></tr>
148-
</table>
149-
{% endif %}
150-
151-
{% if allow_edit %}
152-
<form method="post" action="" name="auto_post_form">
153-
<input type="submit" value="Adjust Meta-Data" value="adjust" /> (Leads to manual post by the Secretariat)
154-
</form>
155-
{% if is_valid %}
156-
<h2>Please edit the following meta-data before proceeding to Auto-Post</h2>
157-
<p>
158-
If you are one of the authors of this document, then please click the button with your name on it to automatically fill in the submitter information as requested below. Otherwise, please manually enter your information.
159-
</p>
160-
<form method="post" action="">
161-
{{ auto_post_form.get_author_buttons|safe }}
162-
<table class="metadata-table">
163-
{{ auto_post_form }}
164-
</table>
165-
<input type="submit" value="Post" name="autopost" />
166-
</form>
167-
{% endif %}
146+
{% if not canceled %}
147+
<form method="post" action="" name="auto_post_form">
148+
<input type="submit" value="Adjust Meta-Data" value="adjust" /> (Leads to manual post by the Secretariat)
149+
</form>
150+
{% if is_valid %}
151+
<h2>Please edit the following meta-data before proceeding to Auto-Post</h2>
152+
<p>
153+
If you are one of the authors of this document, then please click the button with your name on it to automatically fill in the submitter information as requested below. Otherwise, please manually enter your information.
154+
</p>
155+
<form method="post" action="">
156+
{{ auto_post_form.get_author_buttons|safe }}
157+
<table class="metadata-table">
158+
{{ auto_post_form }}
159+
</table>
160+
<input type="submit" value="Post" name="autopost" />
161+
</form>
162+
{% endif %}
163+
164+
<h2>Cancel submission</h2>
165+
<p>
166+
<input type="button" onclick="confirmCancelation();" value="Cancel Submission" /><br>
167+
This submission will be canceled, and its uploaded document(s) permanently deleted.
168+
</p>
168169
{% endif %}
169170

170171
<p>

0 commit comments

Comments
 (0)