-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: hide all information_system attributes from es search views #415
Conversation
TIEDONOHJAUS-API branch is deployed to platta: https://tiedonohjaus-pr415.api.dev.hel.ninja 🚀🚀🚀 |
78d9b94
to
c6ca3cc
Compare
TIEDONOHJAUS-API branch is deployed to platta: https://tiedonohjaus-pr415.api.dev.hel.ninja 🚀🚀🚀 |
search_indices/serializers/base.py
Outdated
@property | ||
def is_authenticated(self): | ||
request = self.context.get("request") | ||
return request and request.user.is_authenticated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO
return request and request.user.is_authenticated | |
return bool(request and request.user.is_authenticated) |
would be a bit better because the name suggests the property will be a boolean, and the original version can return also something else, at least None
.
c6ca3cc
to
f51bd26
Compare
TIEDONOHJAUS-API branch is deployed to platta: https://tiedonohjaus-pr415.api.dev.hel.ninja 🚀🚀🚀 |
f51bd26
to
2885ae3
Compare
TIEDONOHJAUS-API branch is deployed to platta: https://tiedonohjaus-pr415.api.dev.hel.ninja 🚀🚀🚀 |
8f471c9
to
fa42c47
Compare
TIEDONOHJAUS-API branch is deployed to platta: https://tiedonohjaus-pr415.api.dev.hel.ninja 🚀🚀🚀 |
|
||
return super().filter_queryset(queryset) | ||
super().initial(request, *args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this method should return the value of the super call or not, but it shouldn't do both of those. Now it does that for authenticated users and doesn't do it for unauthenticated users, which seems odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, its a mistake. The initial method is not expected to return anything - I'll change this a bit
Previously we restricted the information system from basic filters and views for unauthenticated users. This adds hiding the InformationSystem attribues from unauthenticated users in elastic backed searches as well. Refs TIED-171
fa42c47
to
0d9768a
Compare
Quality Gate failedFailed conditions |
Quality Gate passedIssues Measures |
TIEDONOHJAUS-API branch is deployed to platta: https://tiedonohjaus-pr415.api.dev.hel.ninja 🚀🚀🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 🐎
Previously we restricted the information system from basic drf filters and views for unauthenticated users. This adds hiding the InformationSystem attribues from unauthenticated users in elastic backed searches and views as well.
Refs TIED-171