#33471: AlterField operation should be noop when adding/changing choices.
-------------------------------+------------------------------------
     Reporter:  David Szotten  |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  Migrations     |                  Version:  4.0
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

 * easy:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 It was missed in #25253 (see 9159d173c3822312c653db7ff5b9a94b14af1dca).
 Adding `choices` to the `non_database_attrs` should fix it:
 {{{#!diff
 diff --git a/django/db/backends/base/schema.py
 b/django/db/backends/base/schema.py
 index 4cd4567cbc..822da656d3 100644
 --- a/django/db/backends/base/schema.py
 +++ b/django/db/backends/base/schema.py
 @@ -1130,6 +1130,7 @@ class BaseDatabaseSchemaEditor:
          # - adding only a db_column and the column name is not changed
          non_database_attrs = [
              'blank',
 +            'choices',
              'db_column',
              'editable',
              'error_messages',
 }}}

 Would you like to prepare a patch? (a regression test is required).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33471#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.8355682d4309166f0cb93cabc0d5a43a%40djangoproject.com.

Reply via email to