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

Auto-create Custom Switch Models #456

Closed
cole-jacobs opened this issue Aug 22, 2022 · 2 comments
Closed

Auto-create Custom Switch Models #456

cole-jacobs opened this issue Aug 22, 2022 · 2 comments

Comments

@cole-jacobs
Copy link
Contributor

Auto-creating custom switches fails with: AttributeError: Manager isn't available; 'waffle.Switch' has been swapped for '<custom model>'.

In models.py, the Flag version of is_active calls get_waffle_flag_model before its call to get_or_create. I think a similar pattern should be used for switches and samples. Happy to submit a patch for this tonight.

@clintonb
Copy link
Collaborator

Yes, please patch.

@cole-jacobs
Copy link
Contributor Author

👌 I'll get something up soon. Just noticed the same idea can be added to override_switch and override_sample, so I'll include that as well.

cole-jacobs added a commit to cole-jacobs/django-waffle that referenced this issue Aug 23, 2022
Remove direct references to `Switch` and `Sample` in favor of
`get_waffle_switch_model` and `get_waffle_sample_model`.
cole-jacobs added a commit to cole-jacobs/django-waffle that referenced this issue Aug 23, 2022
Remove direct references to `Switch` and `Sample` in favor of
`get_waffle_switch_model` and `get_waffle_sample_model`.
cole-jacobs added a commit to cole-jacobs/django-waffle that referenced this issue Aug 24, 2022
Remove direct references to `Switch` and `Sample` in favor of
`get_waffle_switch_model` and `get_waffle_sample_model`.
clintonb pushed a commit to cole-jacobs/django-waffle that referenced this issue Aug 24, 2022
Remove direct references to `Switch` and `Sample` in favor of
`get_waffle_switch_model` and `get_waffle_sample_model`.
clintonb pushed a commit that referenced this issue Aug 24, 2022
Remove direct references to `Switch` and `Sample` in favor of
`get_waffle_switch_model` and `get_waffle_sample_model`.
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

2 participants