#26105: create_permissions uses ContentType cache which contains non-existing pks -------------------------------------+------------------------------------- Reporter: srkunze | Owner: nobody Type: Bug | Status: new Component: Database layer | Version: 1.8 (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: | Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by srkunze):
* needs_better_patch: => 0 * needs_tests: => 0 * needs_docs: => 0 Comment: A quick fix we found could be (line 90 to line 100): {{{ all_perms=set(Permission.objects.using(using).filter( content_type__in=ctypes, ).values_list( "content_type__app_label", "content_type__model", "codename" )) perms = [ Permission(codename=codename, name=name, content_type=ct) for ct, (codename, name) in searched_perms if (ct.app_label, ct.model, codename) not in all_perms ] }}} -- Ticket URL: <https://code.djangoproject.com/ticket/26105#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 post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/065.1ef594ad0ed4fe31318d6520013112e7%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.