Skip to content

Commit 9ce212f

Browse files
committed
Only add document comment 'New version available' if draft.idinternal exists. Add comment about substate change from 'Revised ID Needed' after the comment about 'New version available'.
- Legacy-Id: 3087
1 parent 8b1138b commit 9ce212f

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

ietf/submit/utils.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ def perform_post(submission):
5151
draft.status_id = 1 # Active
5252
draft.expired_tombstone = 0
5353
draft.save()
54-
if draft.idinternal and draft.idinternal.cur_sub_state_id == 5 and draft.idinternal.rfc_flag == 0: # Substate 5 Revised ID Needed
55-
draft.idinternal.prev_sub_state_id = draft.idinternal.cur_sub_state_id
56-
draft.idinternal.cur_sub_state_id = 2 # Substate 2 AD Followup
57-
draft.idinternal.save()
58-
state_change_msg = "Sub state has been changed to AD Follow up from New Id Needed"
59-
add_document_comment(None, draft, state_change_msg)
6054
except InternetDraft.DoesNotExist:
6155
draft = InternetDraft.objects.create(
6256
title=submission.id_document_name,
@@ -73,7 +67,14 @@ def perform_post(submission):
7367
intended_status_id=8, # None
7468
)
7569
update_authors(draft, submission)
76-
add_document_comment(None, draft, "New version available")
70+
if draft.idinternal:
71+
add_document_comment(None, draft, "New version available")
72+
if draft.idinternal.cur_sub_state_id == 5 and draft.idinternal.rfc_flag == 0: # Substate 5 Revised ID Needed
73+
draft.idinternal.prev_sub_state_id = draft.idinternal.cur_sub_state_id
74+
draft.idinternal.cur_sub_state_id = 2 # Substate 2 AD Followup
75+
draft.idinternal.save()
76+
state_change_msg = "Sub state has been changed to AD Follow up from New Id Needed"
77+
add_document_comment(None, draft, state_change_msg)
7778
move_docs(submission)
7879
submission.status_id = POSTED
7980
send_announcements(submission, draft, state_change_msg)
@@ -89,8 +90,8 @@ def send_announcements(submission, draft, state_change_msg):
8990

9091
def announce_to_lists(submission):
9192
subject = 'I-D Action: %s-%s.txt' % (submission.filename, submission.revision)
92-
from_email = settings.IDST_ID_EMAIL
93-
to_email = [settings.IDST_ID_ANNOUNCE_LIST]
93+
from_email = settings.IDSUBMIT_ANNOUNCE_FROM_EMAIL
94+
to_email = [settings.IDSUBMIT_ANNOUNCE_LIST_EMAIL]
9495
authors = []
9596
for i in submission.tempidauthors_set.order_by('author_order'):
9697
if not i.author_order:
@@ -116,7 +117,7 @@ def announce_new_version(submission, draft, state_change_msg):
116117
if p.discuss == 1 and p.ad.user_level == IESGLogin.AD_LEVEL:
117118
to_email.append(p.ad.person.email()[1])
118119
subject = 'New Version Notification - %s-%s.txt' % (submission.filename, submission.revision)
119-
from_email = settings.IDST_ID_EMAIL
120+
from_email = settings.IDSUBMIT_ANNOUNCE_FROM_EMAIL
120121
send_mail(None, to_email, from_email, subject, 'submit/announce_new_version.txt',
121122
{'submission': submission,
122123
'msg': state_change_msg})
@@ -126,7 +127,7 @@ def announce_to_authors(submission):
126127
authors = submission.tempidauthors_set.order_by('author_order')
127128
cc = list(set([i.email()[1] for i in authors]))
128129
to_email = [authors[0].email()[1]] # First TempIdAuthor is submitter
129-
from_email = settings.IDST_ID_EMAIL
130+
from_email = settings.IDSUBMIT_ANNOUNCE_FROM_EMAIL
130131
subject = 'New Version Notification for %s-%s.txt' % (submission.filename, submission.revision)
131132
if submission.group_acronym:
132133
wg = submission.group_acronym.group_acronym.acronym

0 commit comments

Comments
 (0)