Fix incorrect 'if' statement for email time counter
@@ -51,17 +51,20 @@ class EmailSendingBehaviour:
# Check if time is out
timenow = datetime.datetime.utcnow()
if timer:
- if timenow <= timer + self.interval:
+ if timer + self.interval <= timenow:
# We should penalize that session
result.append(session)
del time_left[username]
else:
+ #FIXME Remove this later
+ log.debug('Delaying email Next attempt in {}'.format(self.interval - (timenow - timer)))
# That session is not ready to be penalized
pass
else:
# We should penalize any new unauthorized session
time_left[username] = timenow
result.append(session)
+ # self.time_between_notifications = time_left
return result
@override
