Opened 6 years ago
Closed 6 years ago
#29814 closed Bug (fixed)
Allow serializing NoneType in migrations
Description ¶
When in a deconstructible class used in a migration one of the arguments to instantiate the class is the NoneType
(aka type(None)
) this is just serialized as NoneType
which will throw a NameError because it is not defined. The only way to get this value in Python 3 is with type(None)
so simply serializing NoneType
as type(None)
should already do the trick.
Change History (5)
comment:1 by , 6 years ago
Easy pickings: | unset |
---|---|
Summary: | Migrations deconstructing NoneType → Allow serializing NoneType in migrations |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 6 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 6 years ago
Has patch: | set |
---|
comment:4 by , 6 years ago
Triage Stage: | Accepted → Ready for checkin |
---|---|
Version: | 2.1 → master |
Note:
See TracTickets
for help on using tickets.
I've managed to reproduce the issue and will attempt to provide a patch later this week. If anyone is interested in reproducing the issue on their own, the following code generates a problematic migration: