From 57f01952bdb750fb450d288e52b30c35bd1ef9b3 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 9 Dec 2018 21:20:34 +0100 Subject: [PATCH] core: fix bandit issues --- passbook/core/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/passbook/core/models.py b/passbook/core/models.py index ca7e980fc..4e77c807f 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -1,7 +1,7 @@ """passbook core models""" import re from logging import getLogger -from random import randrange +from random import SystemRandom from time import sleep from uuid import uuid4 @@ -230,7 +230,7 @@ class DebugRule(Rule): def passes(self, user: User): """Wait random time then return result""" - wait = randrange(self.wait_min, self.wait_max) + wait = SystemRandom().randrange(self.wait_min, self.wait_max) LOGGER.debug("Rule '%s' waiting for %ds", self.name, wait) sleep(wait) return self.result