Development #52028
warnings concernant ArrayField.default en django 2.2 (vu via installation locale publik-devinst)
0%
Description
base.Job.parameters: (postgres.E003) JSONField default should be a callable instead of an instance so that it's not shared between all field instances. HINT: Use a callable instead, e.g., use `dict` instead of `{}`. ... twilio.TwilioSMSGateway.authorized: (postgres.E003) ArrayField default should be a callable instead of an instance so that it's not shared between all field instances. HINT: Use a callable instead, e.g., use `list` instead of `[]`.
Fichiers
Demandes liées
Révisions associées
Historique
Mis à jour par Nicolas Roche il y a environ 3 ans
Tu saurais le reproduire (je n'ai pas réussi) ?
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
$ ~/envs/publik-env-py3/bin/passerelle-manage check
Mis à jour par Nicolas Roche il y a environ 3 ans
- Fichier 0001-misc-remove-postgres.E003-warnings-52028.patch 0001-misc-remove-postgres.E003-warnings-52028.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Assigné à mis à Nicolas Roche
- Patch proposed changé de Non à Oui
En fait si, je reproduis quand je lance le shell passerelle et quand je construis les migrations.
Et ça semble effectivement lié au passage à django 2.2 (>1.9 info que j'ai glané sur le web).
if you give the field a default, ensure it’s a callable such as list (for an empty default) or a callable that returns a list
(such as a function). Incorrectly using default=[] creates a mutable default that is shared between all instances of ArrayField.
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Statut changé de Solution proposée à En cours
Les AlterField ne sont pas nécessaires concernant un changement de default
parce que c'est juste de la métadonnée Django qui n'a pas d'impact sur le schéma en base; il faut juste modifier les migrations existantes, ça fait un patch plus petit.
Mis à jour par Nicolas Roche il y a environ 3 ans
- Fichier 0001-misc-remove-postgres.E003-warnings-52028.patch 0001-misc-remove-postgres.E003-warnings-52028.patch ajouté
- Statut changé de En cours à Solution proposée
(remarque prise en compte)
Mis à jour par Benjamin Dauvergne il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Nicolas Roche il y a presque 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 384fedc6daf26b4a3ac70d283e3bdbcfa2acd517 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Fri Apr 16 16:27:50 2021 +0200 misc: remove postgres.E003 warnings (#52028)
Mis à jour par Frédéric Péters il y a presque 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Benjamin Dauvergne il y a presque 3 ans
- Lié à Development #53845: Migrations manquantes sur valeur par défaut de champs JSONField ajouté
misc: remove postgres.E003 warnings (#52028)