-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update login.py #5716
base: preview
Are you sure you want to change the base?
Update login.py #5716
Conversation
WalkthroughThe changes involve modifications to the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- apiserver/plane/authentication/utils/login.py (1 hunks)
🔇 Additional comments (3)
apiserver/plane/authentication/utils/login.py (3)
1-8
: LGTM! Import statements and function signature look good.The changes improve readability by separating imports onto individual lines and grouping them according to PEP 8 guidelines. The function signature remains unchanged, which is consistent with the summary.
15-24
: LGTM! Improved formatting of the device_info dictionary.The reformatting of the
device_info
dictionary construction improves readability. The multi-line formatting of thebase_host
function call is consistent with PEP 8 guidelines for line length. The logic and content remain unchanged, which is good.
24-28
: Verify changes in function behavior and clean up formatting.
The
device_info
assignment to the session has been moved outside theif is_admin:
block. This changes the function's behavior as it will now always set thedevice_info
regardless of whether the user is an admin. Please confirm if this is intentional.There are multiple unnecessary empty lines at the end of the function. These should be removed to comply with PEP 8 guidelines.
The final return statement seems to have been removed. If the function is not meant to return anything, this is fine, but please confirm that this was intentional.
Could you please clarify these changes and make the necessary adjustments? Here's a suggested cleanup for the end of the function:
), } - request.session["device_info"] = device_info - - - + request.session["device_info"] = device_infoIf the
device_info
assignment should only happen for admin users, please move it back inside theif is_admin:
block.
Summary by CodeRabbit
Bug Fixes
Refactor