Skip to content

Commit 08f5d1d

Browse files
committed
Preparatory work for adding a 'Replaces' field to the draft submission tool.
- Legacy-Id: 5719
1 parent c72ab5d commit 08f5d1d

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

ietf/submit/forms.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ class AutoPostForm(forms.Form):
322322
def __init__(self, *args, **kwargs):
323323
self.draft = kwargs.pop('draft', None)
324324
self.validation = kwargs.pop('validation', None)
325+
self.replaces = kwargs.pop('replaces', None)
325326
super(AutoPostForm, self).__init__(*args, **kwargs)
326327

327328
def get_author_buttons(self):

ietf/submit/views.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,14 @@ def draft_status(request, submission_id, submission_hash=None, message=None):
107107
message = ('error', 'This submission has been cancelled, modification is no longer possible')
108108
status = detail.status
109109
allow_edit = None
110+
if detail.group_acronym and detail.revision == '00':
111+
replaces = "Replaces draft"
112+
else:
113+
replaces = None
110114

111115
if request.method == 'POST' and allow_edit:
112116
if request.POST.get('autopost', False):
113-
auto_post_form = AutoPostForm(draft=detail, validation=validation, data=request.POST)
117+
auto_post_form = AutoPostForm(draft=detail, validation=validation, replaces=replaces, data=request.POST)
114118
if auto_post_form.is_valid():
115119
try:
116120
preapproval = Preapproval.objects.get(name=detail.filename)
@@ -149,7 +153,7 @@ def draft_status(request, submission_id, submission_hash=None, message=None):
149153
else:
150154
return HttpResponseRedirect(urlreverse(draft_edit, None, kwargs={'submission_id': detail.submission_id }))
151155
else:
152-
auto_post_form = AutoPostForm(draft=detail, validation=validation)
156+
auto_post_form = AutoPostForm(draft=detail, validation=validation, replaces=replaces)
153157

154158
show_notify_button = False
155159
if allow_edit == False or can_cancel == False:

0 commit comments

Comments
 (0)