﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
11652	Simultaneous editing of a record via the admin interface silently overwrites	David Findlay <djangoproject-finhome@…>	nobody	"I am seeing the following situation.

1. sign into admin as user A in one browser and begin to edit a record, e.g. http://example.com/admin/myapp/mymodel/1
1. sign into admin as user B in another browser and begin to edit the SAME record, i.e. same URL as user A
1. make a change as user A and press Save 
1. make a different change as user B and press Save 

The result is that A's change is silently overwritten with user B's change. 

Should it not generate an error when user B saves, informing them that the record has been updated since they started editing it?
That is what I would have expected to have been the default behaviour.

There's likely some corner cases I'm not thinking of, but it seems like this could be checked for by:

1. saving a copy of the model object when a user does the GET of the model's page, the model object with PK of 1 in my example of http://example.com/admin/myapp/mymodel/1
1. during the validation that occurs when the user POSTs their updates, pull the model object from the database again - prior to saving any changes. If that copy of the model is different from the copy retrieved in the previous step, then the model has been updated in the interim by someone else. In that case the error could be passed to the user and the save aborted. If the two copies are the same then the model hasn't been altered in the interim, and the save could proceed as normal.

If there's a standard way of implementing this already I'd be most grateful to know how to go about it."	New feature	closed	contrib.admin	1.1	Normal	wontfix			Design decision needed	0	0	0	0	0	0
