Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting null = false on m2m fields causes migration to fail #334

Open
intigratech opened this issue Apr 27, 2024 · 0 comments
Open

Setting null = false on m2m fields causes migration to fail #334

intigratech opened this issue Apr 27, 2024 · 0 comments

Comments

@intigratech
Copy link

I have a m2m field as follows:

class Contact(RootModel):
categories = fields.ManyToManyField('core.ContactCategory', related_name='contacts', through='fkcontactcategory',
description="Categories", on_delete=fields.SET_NULL)

I set null=False on the field.
categories = fields.ManyToManyField('core.ContactCategory', related_name='contacts', null=False, through='fkcontactcategory', description="Categories", on_delete=fields.SET_NULL)

When performing the migration using command.migrate(app_name) I run into an error:
'bool' object is not subscriptable

Any help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant