-
Notifications
You must be signed in to change notification settings - Fork 367
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
base: master
Are you sure you want to change the base?
Conversation
7c7658e
to
8153729
Compare
37093bb
to
aba4e22
Compare
b0c453f
to
faf2cae
Compare
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 |
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.
把 if request.user.username 写到if里面来
seahub/auth/views.py
Outdated
@@ -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', []) |
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.
already_logs --> already_login_users
seahub/auth/__init__.py
Outdated
@@ -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', []) |
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.
_already_logged-->_already_loging_users, 定义一个全局变量来保存这个session的key
No description provided.