mozilla/kitsune — pull request #897 by mythmon (2012-10-11 22:45:09+00:00)
Title: Show a warning when a KB doc is being edited twice

When a edit page for a KB document or a translation is opened, set a flag
in redis with an expiry of 15 minutes. If the form is then submitted,
the flag will be cleared.

If a user starts editing a document or translation that has it's lock
flag set, a big warning will be displayed, and the form will be
disabled. In case of users being smarter than the system, a button is
provided to "steal" the lock, that enables the form elements and tells
the server to change the owner of the lock. This doesn't prevent the
other user from submitting.

This doesn't stop duplicate edits of documents or translations, it only
provides warnings and gentle barriers.

This doesn't have any tests yet, and it is a big enough bit of code it probably should. I'll look into that next.