Also, if a model has a FK to a proxy model, the `FieldError` that is
supposed to be raised when an any inappropriate field is found in a
`select_for_update()` call will crash with `AttributeError: 'NoneType'
object has no attribute 'name'` .
Tested with postgres but I don't think this is specific to that db.
--
Ticket URL: <https://code.djangoproject.com/ticket/31866>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Daniel Hillier):
Created branch with failing tests here:
https://github.com/danifus/django/tree/b31866
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:1>
* owner: nobody => Daniel Hillier
* status: new => assigned
* has_patch: 0 => 1
Comment:
Submitted a pull request with a fix:
https://github.com/django/django/pull/13283
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:2>
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:3>
* stage: Accepted => Ready for checkin
Comment:
Patch is looking good to me. Thanks for your great patch and test Daniel.
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:4>
Comment (by Daniel Hillier):
Thanks for your help! I've squashed the commits and it is good to go.
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:5>
* version: 3.1 => 2.2
Comment:
This qualifies for a backport as a data loss bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"60626162f76f26d32a38d18151700cb041201fb3" 6062616]:
{{{
#!CommitTicketReference repository=""
revision="60626162f76f26d32a38d18151700cb041201fb3"
Fixed #31866 -- Fixed locking proxy models in
QuerySet.select_for_update(of=()).
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:7>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"f139372491b35d36748f0fb24146fb20f7e1eead" f139372]:
{{{
#!CommitTicketReference repository=""
revision="f139372491b35d36748f0fb24146fb20f7e1eead"
[3.1.x] Fixed #31866 -- Fixed locking proxy models in
QuerySet.select_for_update(of=()).
Backport of 60626162f76f26d32a38d18151700cb041201fb3 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:8>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"784ed4ada112753c35dd7c6b85686ad1d935b65d" 784ed4ad]:
{{{
#!CommitTicketReference repository=""
revision="784ed4ada112753c35dd7c6b85686ad1d935b65d"
[3.0.x] Fixed #31866 -- Fixed locking proxy models in
QuerySet.select_for_update(of=()).
Backport of 60626162f76f26d32a38d18151700cb041201fb3 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:9>
Comment (by Mariusz Felisiak <felisiak.mariusz@…>):
In [changeset:"839f906a23271b24bf435b16575bbbfd0d2ddcf9" 839f906a]:
{{{
#!CommitTicketReference repository=""
revision="839f906a23271b24bf435b16575bbbfd0d2ddcf9"
[2.2.x] Fixed #31866 -- Fixed locking proxy models in
QuerySet.select_for_update(of=()).
Backport of 60626162f76f26d32a38d18151700cb041201fb3 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31866#comment:10>