Bug when the description string was in uppercase
This commit is contained in:
parent
fe5aab4f29
commit
5bdc66fd52
1
TODO
1
TODO
@ -1,3 +1,4 @@
|
||||
* HTTPS for all links (grep http:// *.xml)
|
||||
* link to find-subtags
|
||||
* validity HTML and CSS and Atom
|
||||
* Google webmaster console
|
@ -1,4 +1,4 @@
|
||||
all:
|
||||
all: ltru.rng
|
||||
./copy-and-convert.sh
|
||||
cp ./language-subtag-registry-version ..
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user