Closed
Bug 988857
Opened 11 years ago
Closed 9 years ago
Use .save(update_fields=[...]) everywhere we can, especially in .update() calls
Categories
(Marketplace Graveyard :: Code Quality, defect, P4)
Tracking
(Not tracked)
VERIFIED
FIXED
2015-09-22
People
(Reporter: mat, Assigned: mat)
References
()
Details
(Whiteboard: [repoman] )
Django 1.5 introduces .save(update_fields=[...]), which lets you specify which fields end up in the UPDATE query made to the database. Without this, all fields on the model are pushed to the database, potentially overwriting existing changes (which can be very bad in some cases) and making the UPDATE query potentially huge.
Once we're sure the 1.6 update is good and not going to be reverted, we should use that new parameter everywhere we can, particular in our .update() method.
Updated•11 years ago
|
Blocks: tarako-marketplace
Updated•11 years ago
|
No longer blocks: tarako-marketplace
Assignee | ||
Updated•10 years ago
|
Whiteboard: [repoman]
Assignee | ||
Comment 1•10 years ago
|
||
<instance>.update() actually calls <instance>.__class__>.objects.filter(pk=<instance>.pk).update(...), so it's already doing the right thing. Not sure why I thought it wasn't.
Nevertheless, it does some hackery with signals that wouldn't be necessary anymore if using .save(update_fields=[...]) so this bug is still relevant, just less important.
Priority: P2 → P3
Assignee | ||
Updated•10 years ago
|
Priority: P3 → P4
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → mpillard
Assignee | ||
Comment 2•9 years ago
|
||
Fixed in https://github.com/mozilla/zamboni/commit/92661c1633e755776433a68af12f5cc36de0d7fd
QA:
- Every part of the site that saves data could be affected by this change. Please test that submitting an app and reviewing it still works, that should be enough to verify that it works properly.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2015-09-22
Comment 3•9 years ago
|
||
Verified in FF43(Win7) in marketplace-dev.allizom.org
Submitting and reviewing apps still works. There is an issue when adding content rating. There is a bug for that: Bug 1206089
Mathieu do you think this is related?
Flags: needinfo?(mpillard)
Assignee | ||
Comment 4•9 years ago
|
||
No, Content Ratings were broken already. See https://bugzilla.mozilla.org/show_bug.cgi?id=1203489
Flags: needinfo?(mpillard)
You need to log in
before you can comment on or make changes to this bug.
Description
•