# HG changeset patch # User neko259 # Date 2016-12-25 20:08:10 # Node ID 8c19026d270e9fca704a7fcb315c925e6483480c # Parent 13d5acda58be0da9d89ddc0a64c9fd6d8fe1a022 Ignore getting domain of a malformed link diff --git a/boards/utils.py b/boards/utils.py --- a/boards/utils.py +++ b/boards/utils.py @@ -154,6 +154,9 @@ def get_domain(url: str) -> str: Gets domain from an URL with random number of domain levels. """ levels = url.split('.') + if len(levels) < 2: + return url + top = levels[-1] second = levels[-2]