#23422: Cannot add Permission to Group in data migration
-----------------------------+--------------------------------------
     Reporter:  Tomas Walch  |                    Owner:  nobody
         Type:  Bug          |                   Status:  closed
    Component:  Migrations   |                  Version:  1.7
     Severity:  Normal       |               Resolution:  wontfix
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  1
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+--------------------------------------

Comment (by Floréal Cabanettes):

 Replying to [comment:20 Alan Justino da Silva]:

 It still works with django 2.2 with some few changes:


 {{{
 from django.core.management.sql import emit_post_migrate_signal

 def create_group(apps, schema_editor):
     emit_post_migrate_signal(2, False, 'default')
     Group = apps.get_model('auth', 'Group')
     Permission = apps.get_model('auth', 'Permission')
     (...)
 }}}

 Thank you, because else, I can't use migration for that, and it should be
 a problem!

-- 
Ticket URL: <https://code.djangoproject.com/ticket/23422#comment:28>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.57abcbd1f7a591d1f39b629f576b70b2%40djangoproject.com.

Reply via email to