Bug when the description string was in uppercase

This commit is contained in:
Stephane Bortzmeyer 2023-10-17 14:55:49 +02:00
parent fe5aab4f29
commit 5bdc66fd52
3 changed files with 10 additions and 2 deletions

1
TODO
View File

@ -1,3 +1,4 @@
* HTTPS for all links (grep http:// *.xml)
* link to find-subtags
* validity HTML and CSS and Atom
* Google webmaster console

View File

@ -1,4 +1,4 @@
all:
all: ltru.rng
./copy-and-convert.sh
cp ./language-subtag-registry-version ..

View File

@ -12,6 +12,9 @@ import psycopg2
from yattag import Doc
# TODO include the standard elements such as CSS and footer
# For testing only:
import wsgiref.simple_server
REDIRECTION_URL = "https://www.langtag.net/registries/registry-html" # For
# local testing: Firefox apparently does not accept a redirect to a
# file.
@ -105,7 +108,7 @@ def application(environ, start_response):
sql = "SELECT Regions.code, Descriptions.description FROM Regions,Descriptions_Regions,Descriptions WHERE Descriptions_Regions.description = Descriptions.id AND Descriptions_Regions.region = Regions.code AND position(%s in lower(Descriptions.description)) > 0;"
elif form["what"] == "variant":
sql = "SELECT Variants.code, Descriptions.description FROM Variants,Descriptions_Variants,Descriptions WHERE Descriptions_Variants.description = Descriptions.id AND Descriptions_Variants.variant = Variants.code AND position(%s in lower(Descriptions.description)) > 0;"
cursor.execute(sql, (form["string"], ))
cursor.execute(sql, (form["string"].lower(), ))
found = False
with tag("h1"):
text("Results for %s" % form["string"])
@ -126,3 +129,7 @@ def application(environ, start_response):
# Initialize
conn = psycopg2.connect("dbname=lsr")
cursor = conn.cursor()
if __name__ == "__main__":
httpd = wsgiref.simple_server.make_server("", 4000, application)
httpd.serve_forever()