create suspicious request detector and policy, add request to policy engine

This commit is contained in:
Jens Langhammer
2019-03-03 20:26:25 +01:00
parent 1a1005f80d
commit fb82d56307
21 changed files with 256 additions and 13 deletions

View File

@ -24,7 +24,7 @@ class PasswordExpiryPolicy(Policy):
"""If password change date is more than x days in the past, call set_unusable_password
and show a notice"""
actual_days = (now() - user.password_change_date).days
days_since_expiry = now() - (user.password_change_date + timedelta(days=self.days)).days
days_since_expiry = (now() - (user.password_change_date + timedelta(days=self.days))).days
if actual_days >= self.days:
if not self.deny_only:
user.set_unusable_password()