Rule out edge case where MAX_CAPTCHAS is 0
このコミットが含まれているのは:
コミット
c3237890ad
|
@ -33,8 +33,6 @@ def get_random_captcha_digest():
|
||||||
solution = generate_random_captcha_solution()
|
solution = generate_random_captcha_solution()
|
||||||
digest = generate_captcha_digest(CAPTCHA_SIGNER, salt, solution)
|
digest = generate_captcha_digest(CAPTCHA_SIGNER, salt, solution)
|
||||||
CAPTCHAS[digest] = {'solution': solution}
|
CAPTCHAS[digest] = {'solution': solution}
|
||||||
while len(CAPTCHAS) >= CONFIG['MAX_CAPTCHAS']:
|
|
||||||
CAPTCHAS.popitem(last=False)
|
|
||||||
|
|
||||||
return digest
|
return digest
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ def toml_to_flask_section_names(config):
|
||||||
def toml_to_flask_section_memory(config):
|
def toml_to_flask_section_memory(config):
|
||||||
cfg = config['memory']
|
cfg = config['memory']
|
||||||
assert cfg['states'] >= 0
|
assert cfg['states'] >= 0
|
||||||
|
assert cfg['captchas'] >= 1
|
||||||
assert cfg['failures'] >= 0
|
assert cfg['failures'] >= 0
|
||||||
assert cfg['chat_scrollback'] >= 0
|
assert cfg['chat_scrollback'] >= 0
|
||||||
assert cfg['chat_messages'] >= cfg['chat_scrollback']
|
assert cfg['chat_messages'] >= cfg['chat_scrollback']
|
||||||
|
|
読み込み中…
新しいイシューから参照