More robust patron-load interface
authorDan Scott <dan@coffeecode.net>
Fri, 30 Aug 2019 16:29:59 +0000 (12:29 -0400)
committerDan Scott <dan@coffeecode.net>
Fri, 30 Aug 2019 16:29:59 +0000 (12:29 -0400)
Feels bad to be hard-coding the path in the template, but something in
the reverse proxy broke, so let's just ensure that we're complying with
expectations. Not a bad thing to add in an isnumeric() check for
example.

Signed-off-by: Dan Scott <dan@coffeecode.net>
tools/patron-load/templates/index.html
tools/patron-load/webui.py

index 90e2de8..d9e51c0 100644 (file)
@@ -28,7 +28,7 @@ $if uid:
         and affiliation with Laurentian (student, staff, faculty, alumnus).</p>
 
 <h2>Create an account</h2>
-<form action="/">
+<form action="/patron-load">
     <label>Laurentian ID: <input name="uid"></label>
     <input type="submit">
 </form>
index 8a1af80..49437db 100644 (file)
@@ -28,10 +28,12 @@ class Index:
 
         i = web.input(uid=None)
 
-        if i.uid:
+        if i.uid and i.uid.isnumeric():
             uid = i.uid
+        else:
+            uid = None
 
-        if uid:
+        if uid is not None:
             self.args.uid(uid)
             users = ldap_osrf_sync.main(self.args)