-
Notifications
You must be signed in to change notification settings - Fork 91
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
🩹 Do not send link users can't read in problem report resolution #764
base: main
Are you sure you want to change the base?
Conversation
dcc5485
to
4469f6d
Compare
froide/problem/utils.py
Outdated
@@ -23,6 +26,14 @@ def inform_managers(report): | |||
) | |||
|
|||
|
|||
def can_read(user, foirequest): | |||
request_factory = RequestFactory() |
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.
This just feels a bit odd to me. Should we refactor froide/helper/auth.py
, such that it takes a user directly, instead of a request object?
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.
Request is needed because of possible session tokens and OAuth stuff that doesn't live on the user. But maybe we need a helper that makes creating a fake request for a user more convenient.
froide/problem/utils.py
Outdated
request = request_factory.get(foirequest.get_absolute_url()) | ||
request.user = user | ||
|
||
can_read_foirequest(foirequest, request) |
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.
This should return!
4469f6d
to
6ce015d
Compare
6ce015d
to
6925ef2
Compare
6925ef2
to
1bb5afc
Compare
No description provided.