Skip to content

Commit a92636f

Browse files
committed
Don't try to save a new doc state and a state_change_event if the new state is the same as the old state. Fixes issue ietf-tools#1045.
- Legacy-Id: 5759
1 parent fb68f35 commit a92636f

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

ietf/idrfc/views_edit.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,13 +1119,11 @@ def request_publication(request, name):
11191119

11201120
# change state
11211121
prev_state = doc.get_state(next_state.type)
1122-
1123-
doc.set_state(next_state)
1124-
1125-
e = add_state_change_event(doc, request.user.get_profile(), prev_state, next_state)
1126-
1127-
doc.time = e.time
1128-
doc.save()
1122+
if next_state != prev_state:
1123+
doc.set_state(next_state)
1124+
e = add_state_change_event(doc, request.user.get_profile(), prev_state, next_state)
1125+
doc.time = e.time
1126+
doc.save()
11291127

11301128
return HttpResponseRedirect(urlreverse('doc_view', kwargs={'name': doc.name}))
11311129

0 commit comments

Comments
 (0)