Commits

remram44  committed 926bfed

MISERY_SLOW_STRENGHT renamed to MISERY_SLOW_STRENGTH.

  • Participants
  • Parent commits dea05b2

Comments (0)

Files changed (2)

 
 The following settings can be personnalized:
 
-* `MISERY_SLOW_STRENGHT`: seconds that miserable users will have to wait _at least_ (maximum twice longer) (default: 6)
+* `MISERY_SLOW_STRENGTH`: seconds that miserable users will have to wait _at least_ (maximum twice longer) (default: 6)
 * `MISERY_LOGOUT_PROBABILITY`: **percentage** of probability a user will be disconnected (default: 10)
 * `MISERY_403_PROBABILITY`: same for 403 (default: 10)
 * `MISERY_404_PROBABILITY`: I'm gonna let you guess for this one (default: 10)

File django_misery/middleware.py

 
 logger = logging.getLogger('django_misery')
 
-slowBanStrenght = getattr(settings, 'MISERY_SLOW_STRENGHT', '6')
+slowBanStrength = getattr(settings, 'MISERY_SLOW_STRENGTH', '6')
 logoutProbability = getattr(settings, 'MISERY_LOGOUT_PROBABILITY', '10')
 e403Probability = getattr(settings, 'MISERY_403_PROBABILITY', '10')
 e404Probability = getattr(settings, 'MISERY_404_PROBABILITY', '10')
 
         if is_miserized:
             # unleash the wrath
-            sleep(randint(int(slowBanStrenght), 2*int(slowBanStrenght)))
+            sleep(randint(int(slowBanStrength), 2*int(slowBanStrength)))
             
             if randint(0, 100) <= int(logoutProbability):
                 logout(request)