2424from ietf .doc .utils import ( add_state_change_event , can_adopt_draft ,
2525 get_tags_for_stream_id , nice_consensus ,
2626 update_reminder , update_telechat , make_notify_changed_event , get_initial_notify ,
27- set_replaces_for_document , default_consensus )
27+ set_replaces_for_document , default_consensus , tags_suffix , )
2828from ietf .doc .lastcall import request_last_call
2929from ietf .doc .fields import SearchableDocAliasesField
3030from ietf .group .models import Group , Role
@@ -83,6 +83,7 @@ def change_state(request, name):
8383 tag = form .cleaned_data ['substate' ]
8484 comment = form .cleaned_data ['comment' ].strip ()
8585
86+ msg = ""
8687
8788 # tag handling is a bit awkward since the UI still works
8889 # as if IESG tags are a substate
@@ -99,6 +100,10 @@ def change_state(request, name):
99100 e = add_state_change_event (doc , login , prev_state , new_state ,
100101 prev_tags = prev_tags , new_tags = new_tags )
101102
103+ msg += "%s changed:\n \n New State: %s\n \n " % (e .state_type .label , new_state .name + tags_suffix (new_tags ))
104+ if prev_state :
105+ msg += "(The previous state was %s)\n \n " % (prev_state .name + tags_suffix (prev_tags ))
106+
102107 events .append (e )
103108
104109 if comment :
@@ -109,12 +114,12 @@ def change_state(request, name):
109114 c .desc = comment
110115 c .save ()
111116
117+ msg += c .desc + "\n "
118+
112119 events .append (c )
113120
114121 doc .save_with_history (events )
115122
116- msg = u"\n " .join (e .desc for e in events )
117-
118123 email_state_changed (request , doc , msg ,'doc_state_edited' )
119124
120125 if new_state .slug == "approved" and new_tags == [] and has_role (request .user , "Area Director" ):
0 commit comments