Skip to content

Some rules are not instantiated #32

Description

@smirolo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions