Skip to content

Commit e0e930f

Browse files
committed
Fixed a situation where the Change IETF WG State form gave an exception when the form was submitted empty, instead of informing the user.
- Legacy-Id: 11943
1 parent ec684e1 commit e0e930f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ietf/doc/views_draft.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,9 +1466,11 @@ def change_stream_state(request, name, state_type):
14661466
e.save()
14671467
events.append(e)
14681468

1469-
doc.save_with_history(events)
1470-
1471-
return HttpResponseRedirect(doc.get_absolute_url())
1469+
if events:
1470+
doc.save_with_history(events)
1471+
return HttpResponseRedirect(doc.get_absolute_url())
1472+
else:
1473+
form.add_error(None, "No change in state or tags found, and no comment provided -- nothing to do.")
14721474
else:
14731475
form = ChangeStreamStateForm(initial=dict(new_state=prev_state.pk if prev_state else None, tags= doc.tags.all()),
14741476
doc=doc, state_type=state_type, can_set_sub_pub = can_set_sub_pub,stream = doc.stream)

0 commit comments

Comments
 (0)