mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-01 23:47:40 +00:00
[Update] 修改只有local用户需要发送创建成功邮件、发送密码过期邮件;
This commit is contained in:
@@ -22,15 +22,15 @@ logger = get_logger(__file__)
|
||||
|
||||
@shared_task
|
||||
def check_password_expired():
|
||||
users = User.objects.exclude(role=User.ROLE_APP)
|
||||
users = User.objects.filter(source=User.SOURCE_LOCAL).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)
|
||||
msg = "The user {} password expires in {} days"
|
||||
logger.info(msg.format(user, user.password_expired_remain_days))
|
||||
send_password_expiration_reminder_mail(user)
|
||||
|
||||
|
||||
@shared_task
|
||||
@@ -55,6 +55,8 @@ def check_user_expired():
|
||||
continue
|
||||
if not user.will_expired:
|
||||
continue
|
||||
msg = "The user {} will expires in {} days"
|
||||
logger.info(msg.format(user, user.expired_remain_days))
|
||||
send_user_expiration_reminder_mail(user)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user