Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
4fe74e9e
Unverified
Commit
4fe74e9e
authored
Jul 30, 2019
by
BaiJiangJie
Committed by
GitHub
Jul 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3051 from jumpserver/dev_bai
[Update] 密码过期邮件发送(密码未过期用户&有效用户)
parents
b5aa69db
637fc914
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
user.py
apps/users/models/user.py
+1
-1
tasks.py
apps/users/tasks.py
+4
-4
No files found.
apps/users/models/user.py
View file @
4fe74e9e
...
...
@@ -111,7 +111,7 @@ class AuthMixin:
@property
def
password_will_expired
(
self
):
if
self
.
is_local
and
self
.
password_expired_remain_days
<
5
:
if
self
.
is_local
and
0
<=
self
.
password_expired_remain_days
<
5
:
return
True
return
False
...
...
apps/users/tasks.py
View file @
4fe74e9e
...
...
@@ -20,13 +20,13 @@ logger = get_logger(__file__)
def
check_password_expired
():
users
=
User
.
objects
.
exclude
(
role
=
User
.
ROLE_APP
)
for
user
in
users
:
if
not
user
.
is_valid
:
continue
if
not
user
.
password_will_expired
:
continue
send_password_expiration_reminder_mail
(
user
)
logger
.
info
(
"The user {} password expires in {} days"
.
format
(
user
,
user
.
password_expired_remain_days
)
)
msg
=
"The user {} password expires in {} days"
logger
.
info
(
msg
.
format
(
user
,
user
.
password_expired_remain_days
))
@shared_task
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment