From c8d084f9ffc6f0c30252c7ba875d119f37c46a2a Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 11 Feb 2017 18:01:44 -0600 Subject: [PATCH] karma: don't create a key > len(200) should resolve bss/dr.botzo#9 --- karma/ircplugin.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/karma/ircplugin.py b/karma/ircplugin.py index 69eb10d..aee8cc1 100644 --- a/karma/ircplugin.py +++ b/karma/ircplugin.py @@ -63,6 +63,11 @@ class Karma(Plugin): key = match[0] if match[0] else match[1] value = match[2] + log.debug("key length: %d", len(key)) + if len(key) > KarmaKey._meta.get_field('key').max_length: + log.warning("given a key longer than %d, ignoring", KarmaKey._meta.get_field('key').max_length) + return + karma_key, c = KarmaKey.objects.get_or_create(key=key) if value == '++':