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
Self user details for logged in user #6338
Self user details for logged in user #6338
Conversation
Currently, we cannot determine the user details of the user which is logged in without passing the id, so method is modified to fetch the details of the current user if the user is logged in.
@@ -1386,6 +1388,9 @@ def user_show(context, data_dict): | |||
''' | |||
model = context['model'] | |||
|
|||
if 'user' in context and 'id' not in data_dict: | |||
data_dict['id'] = context.get('user') | |||
|
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.
The way you've made this change the optional user_obj
will never be used.
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.
@wardi Fixed.
@shubham-mahajan thanks. On second thought while we're here it would be better to completely disable the Also please add a changes file for this new feature so that it appears in the changelog of our next release. |
This param is not needed anymore and may cause issue
@wardi Agree with the removal of Updated the code and updated the changes file also for easy changelog handling. |
@wardi Anything needed for this PR? |
Fixes #5490
Proposed fixes:
As discussed in #5504 (comment), we are not creating an extra action but adding the functionality in the current
user_show
action. So added the check to validate whether the user is logged in and if logged in return the user details.Features:
Please [X] all the boxes above that apply