enforce lower case chars on add/import

This commit is contained in:
lza_menace 2021-03-06 23:10:06 -08:00
parent ea2834eedb
commit 5cda6ecf81
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ def add():
flash("This doesn\"t look like a valid URL")
else:
_url = urlparse(url)
url = f"{_url.scheme}://{_url.netloc}"
url = f"{_url.scheme}://{_url.netloc}".lower()
if Node.select().where(Node.url == url).exists():
flash("This node is already in the database.")
else:
@ -187,7 +187,7 @@ def import_():
with open(export_dir, 'r') as f:
for url in f.readlines():
try:
n = url.rstrip()
n = url.rstrip().lower()
logging.info(f"Adding {n}")
node = Node(url=n)
node.save()