Skip to content

Commit 8657e4f

Browse files
committed
Redirect when POSTing on workflow customization page to prevent the
history from filling up with spam entries - Legacy-Id: 6138
1 parent 9409814 commit 8657e4f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ietf/wginfo/edit.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ def customize_workflow(request, acronym):
343343
else:
344344
group.unused_states.add(state)
345345

346+
# redirect so the back button works correctly, otherwise
347+
# repeated POSTs fills up the history
348+
return redirect("ietf.wginfo.edit.customize_workflow", acronym=group.acronym)
349+
346350
if action == "setnextstates":
347351
try:
348352
state = State.objects.get(pk=request.POST.get("state"))
@@ -358,6 +362,8 @@ def customize_workflow(request, acronym):
358362
transitions, _ = GroupStateTransitions.objects.get_or_create(group=group, state=state)
359363
transitions.next_states = next_states
360364

365+
return redirect("ietf.wginfo.edit.customize_workflow", acronym=group.acronym)
366+
361367
if action == "settagactive":
362368
active = request.POST.get("active") == "1"
363369
try:
@@ -370,6 +376,8 @@ def customize_workflow(request, acronym):
370376
else:
371377
group.unused_tags.add(tag)
372378

379+
return redirect("ietf.wginfo.edit.customize_workflow", acronym=group.acronym)
380+
373381

374382
# put some info for the template on tags and states
375383
unused_tags = group.unused_tags.all().values_list('slug', flat=True)

0 commit comments

Comments
 (0)