Remediate the 2026-09-03 feature-test findings
This commit is contained in:
@@ -503,8 +503,19 @@ def restore_revision(guideid, revisionid):
|
||||
'You do not have permission to edit this guide',
|
||||
http_code=403)
|
||||
|
||||
before = guide.revision
|
||||
authoring.restore(guide, revision, userid=_userid())
|
||||
db.session.commit()
|
||||
|
||||
# save() dedups on the content hash, so restoring the version that is
|
||||
# already current writes nothing. Saying "Restored version N as a new draft
|
||||
# version" in that case describes a revision that does not exist - and the
|
||||
# revision list, unchanged, quietly disagrees with the message.
|
||||
if guide.revision == before:
|
||||
return success_response(
|
||||
guide.to_dict(includeblocks=True),
|
||||
message='Version {} is already the current content, so nothing '
|
||||
'changed'.format(revision.revision))
|
||||
return success_response(guide.to_dict(includeblocks=True),
|
||||
message='Restored version {} as a new draft version'
|
||||
.format(revision.revision))
|
||||
|
||||
Reference in New Issue
Block a user