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

RecursionError possible with .only on RBAC assignment models #449

Open
AlanCoding opened this issue Jun 11, 2024 · 0 comments · May be fixed by #482
Open

RecursionError possible with .only on RBAC assignment models #449

AlanCoding opened this issue Jun 11, 2024 · 0 comments · May be fixed by #482
Labels
app:rbac bug Something isn't working

Comments

@AlanCoding
Copy link
Member

Bug Summary

Steps to reproduce

Run bootstrap script.

Go into python manage.py shell_plus.

RoleUserAssignment.objects.only('object_id')

Expected behavior

Gives a list of object_ids, similar to the normal query

RoleUserAssignment.objects.all()

Actual Results

RecursionError: maximum recursion depth exceeded

Cycle is somehow related to:

File ~/repos/awx/testing/django-ansible-base/ansible_base/rbac/models.py:392, in AssignmentBase.__init__(self, *args, **kwargs)
    389 super().__init__(*args, **kwargs)
    391 # Cache fields from the associated object_role
--> 392 if self.object_role_id and not self.object_id:
    393     self.object_id = self.object_role.object_id
    394     self.content_type_id = self.object_role.content_type_id
@AlanCoding AlanCoding added bug Something isn't working app:rbac labels Jun 11, 2024
@AlanCoding AlanCoding linked a pull request Jun 20, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:rbac bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant