-
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 #5720
base: preview
Are you sure you want to change the base?
Update login.py #5720
Conversation
WalkthroughThe changes involve modifications to the Changes
Poem
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: 0
🧹 Outside diff range and nitpick comments (1)
apiserver/plane/authentication/utils/login.py (1)
1-28
: Improve code formatting and remove unnecessary whitespaceWhile the changes don't introduce any functional issues, there are some formatting inconsistencies and unnecessary whitespace. Consider the following improvements:
- Remove unnecessary empty lines (lines 4, 14, 26-28).
- Standardize indentation throughout the file. The
device_info
dictionary (lines 15-24) uses a different indentation style compared to the rest of the file.- Ensure consistent spacing around operators and after commas.
Here's a suggested diff to address these issues:
#Django imports from django.contrib.auth import login from django.conf import settings - from plane.authentication.utils.host import base_host - # Module imports def user_login(request, user, is_app=False, is_admin=False, is_space=False): login(request, user) -# If is admin cookie set the custom age + # If is admin cookie set the custom age if is_admin: request.session.set_expiry(settings.ADMIN_SESSION_COOKIE_AGE) - - device_info = { - "user_agent": request.META.get("HTTP_USER_AGENT",""), - "ip_address": request.META.get("REMOTE_ADDR", ""), - "domain": base_host( - request=request, - is_app=is_app, - is_admin=is_admin, - is_space=is_space, - ), - } + + device_info = { + "user_agent": request.META.get("HTTP_USER_AGENT", ""), + "ip_address": request.META.get("REMOTE_ADDR", ""), + "domain": base_host( + request=request, + is_app=is_app, + is_admin=is_admin, + is_space=is_space + ), + } request.session["device_info"] = device_info - - -These changes will improve code readability and maintain consistency throughout the file.
Summary by CodeRabbit