﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26385	Squashing migrations with Python 2.7 adds bytestring prefix to ManyToManyField 'to' values which fails to run on Python 3	Brian May	nobody	"In attempting a work around for #26384 by squashing the commits, I found another problem:

{{{
E           AssertionError: ManyToManyField(b'spud.album') is invalid. First parameter to ManyToManyField must be either a model, a model name, or the string 'self'
}}}

I believe the problem is that it used a byte value instead of a string.

{{{
        migrations.AddField(
            model_name='photo',
            name='albums',
            field=models.ManyToManyField(related_name='photos', through='spud.photo_album', to=b'spud.album'),
        ),
}}}

This works fine with Python 2.7 but not with Python 3.4.

The original before squashing was ok:

{{{
        migrations.AddField(
            model_name='photo',
            name='albums',
            field=models.ManyToManyField(related_name='photos', through='spud.photo_album', to='spud.album'),
            preserve_default=True,
        ),
}}}"	Bug	closed	Migrations	1.9	Normal	wontfix	py2		Accepted	0	0	0	0	0	0
