From b6754b2ea3c94131639c762de5fe1facf41ef663 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Fri, 25 Apr 2025 17:04:40 +0300 Subject: Return a zero when the species is unspecified. Signed-off-by: Munyoki Kilyungi --- gn3/db/wiki.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gn3/db/wiki.py') diff --git a/gn3/db/wiki.py b/gn3/db/wiki.py index 7565f05..f422589 100644 --- a/gn3/db/wiki.py +++ b/gn3/db/wiki.py @@ -48,6 +48,8 @@ def get_latest_comment(connection, comment_id: int) -> int: def get_species_id(cursor, species_name: str) -> int: """Find species id given species `Name`""" + if species_name.lower() == "no specific species": + return 0 cursor.execute( "SELECT SpeciesID from Species WHERE Name = %s", (species_name,)) species_ids = cursor.fetchall() -- cgit 1.4.1