Skip to content
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

Send notification for new device #6555

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

awu0403
Copy link
Contributor

@awu0403 awu0403 commented Aug 14, 2024

No description provided.

@awu0403 awu0403 force-pushed the send-notification-for-new-device branch from 7c7658e to 8153729 Compare August 14, 2024 08:30
@awu0403 awu0403 force-pushed the send-notification-for-new-device branch 2 times, most recently from 37093bb to aba4e22 Compare August 15, 2024 02:38
@awu0403 awu0403 force-pushed the send-notification-for-new-device branch from b0c453f to faf2cae Compare August 16, 2024 02:02
request.session.flush()
if request.user.username not in already_logged_list:
already_logged_list.append(request.user.username)
request.session['_already_logged'] = already_logged_list
if hasattr(request, 'user'):
from seahub.base.accounts import User
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

把 if request.user.username 写到if里面来

@@ -73,6 +77,21 @@ def log_user_in(request, user, redirect_to):

# Okay, security checks complete. Log the user in.
auth_login(request, user)
enable_login_email = bool(UserOptions.objects.get_login_email_enable_status(user.username))
already_logs = request.session.get('_already_logged', [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

already_logs --> already_login_users

@@ -106,7 +106,11 @@ def logout(request):
session data.
Also remove all passwords used to decrypt repos.
"""
already_logged_list = request.session.get('_already_logged', [])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_already_logged-->_already_loging_users, 定义一个全局变量来保存这个session的key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants