home · contact · privacy
Catch POSTs to undefined targets, expand and refactor tests.
[plomtask] / plomtask / http.py
index 3dde6e200ed50d5b7dab65e7c648dceacee1ed82..cd3e4459dbe96f6ad0a65cba6ddf45a3162f0f3f 100644 (file)
@@ -128,7 +128,10 @@ class TaskHandler(BaseHTTPRequestHandler):
             form_data = PostvarsParser(postvars)
             if site in ('day', 'process'):
                 getattr(self, f'do_POST_{site}')(conn, params, form_data)
-            conn.commit()
+                conn.commit()
+            else:
+                msg = f'Page not known as POST target: /{site}'
+                raise NotFoundException(msg)
             conn.close()
             self._redirect('/')
         except HandledException as error: