-
Notifications
You must be signed in to change notification settings - Fork 148
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
AttributeError: 'NoneType' when trying to access the admin panel view list #185
Comments
UPDATE 1.0:to solve the issue use this mixin instead of the default one this will solve the error.
|
Depending on your use case, I just handled it in the following way (example): @rules.predicate
def is_author(user, item):
if item is not None:
return user == item.author
return False This will allow the rule to pass with a sensible outcome (no item means the user is not the author) and allows the list to be displayed in the admin. Maybe this needs to be explained in the documentation as a case that can occur and would need to be handled in the rule itself? Also to be noted that the |
I am getting this error when trying to access the view list in the admin panel: AttributeError, as no selected provider is selected when I try to access the providers list!!
![image](https://private-user-images.githubusercontent.com/53629777/324091648-95d182f0-f2b1-4821-8493-8a4bce016b29.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDAxMDYwNjIsIm5iZiI6MTc0MDEwNTc2MiwicGF0aCI6Ii81MzYyOTc3Ny8zMjQwOTE2NDgtOTVkMTgyZjAtZjJiMS00ODIxLTg0OTMtOGE0YmNlMDE2YjI5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjIxVDAyNDI0MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgzNjgzM2ZiNGE4OTI0NzJhY2NlMDM4Njg5ODlhMTdjNTVlMDUzYWZlM2ViYzRjMGQyMTlmM2EwNmY4ZmE3NzYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pT1SIScSvd3mNk9LLPJW1XxJu58nTzB2Y4pjEffHBAQ)
'NoneType' object has no attribute 'company'
rules:
admin code:
The text was updated successfully, but these errors were encountered: