Bump Django 4.2 and DRF 3.15.2
https://redmine.teklia.com/issues/7215
Requires a new base image build: https://gitlab.teklia.com/arkindex/backend/-/pipelines/178545
- Django tried to recreate the
element_image_and_polygoncheck constraint, but I have confirmed that the generated SQL for the constraint has not changed at all. I have instead updated theinitialmigration to ignore this. - Django's
ArrayFieldimplementation now uses'{}'::uuid[]instead ofARRAY[]::uuid[]for empty UUID arrays in ElementPath. It makes zero difference in how the queries run. The diffs in this MR show{{}}, but that's because thesql_validationfiles are used as Python format strings, so we have to escape the brackets. - DRF got smarter and adds more validators than before, but some of them were duplicated or unwarranted, so I had to update or remove them.
- Some of the validator updates were indeed useful, as their validation is now skipped when using
PartialUpdateif their fields are not updated, so there actually were less queries in a few endpoints. - I found this bug in Django, which caused unexpected SQL queries when slicing a union with 0 items, which is what the DRF pagination does on
ListEntityElementsandListTranscriptionswithrecursive=Truewhen there are no results. - I pinned
sqlparsefor unit tests because CI was failing after an update. It used to not recognize the@>operator on paths, so it would show it as@ >, but it now understands it so I removed the space.
Edited by Erwan Rouchet