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

Some rules are not instantiated #32

Open
smirolo opened this issue Feb 22, 2022 · 0 comments
Open

Some rules are not instantiated #32

smirolo opened this issue Feb 22, 2022 · 0 comments

Comments

@smirolo
Copy link
Contributor

smirolo commented Feb 22, 2022

When using saas.decorators.fail_direct as a rule, the various RoleDescription in the database for which organization_id is NULL are not showing up as options in the rules dashboard.

bndlIXnyMnC10SU8

The problem stems from this query in rules.views.app:

                    try:
                        queryset = cls.objects.filter(
                            organization=self.app.account)
                    except FieldError:
                        queryset = cls.objects.all()

role descriptions which are global by nature use organization_id == NULL so the queryset returned is empty here. We cannot blindly add the is_null condition either otherwise a duplicate rule is created for Direct Managers - once through the queryset and once through fail_direct_strong.

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