call group_changes only if restore was not queried
This commit is contained in:
parent
259f7a14b9
commit
3597abc632
1 changed files with 2 additions and 2 deletions
|
@ -22,8 +22,6 @@ def changeset_detail(request, pk, show_history=False):
|
|||
can_edit = False
|
||||
changeset = get_object_or_404(ChangeSet.qs_for_request(request), pk=pk)
|
||||
|
||||
ctx = group_changes(changeset, can_edit=can_edit, show_history=show_history)
|
||||
|
||||
if request.method == 'POST':
|
||||
restore = request.POST.get('restore')
|
||||
if restore.isdigit():
|
||||
|
@ -35,6 +33,8 @@ def changeset_detail(request, pk, show_history=False):
|
|||
messages.success(request, _('Original state has been restored!'))
|
||||
return redirect(request.path)
|
||||
|
||||
ctx = group_changes(changeset, can_edit=can_edit, show_history=show_history)
|
||||
|
||||
if show_history:
|
||||
return render(request, 'editor/changeset_history.html', ctx)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue