diff --git a/website/web/__init__.py b/website/web/__init__.py index c59c354d..6d9deae0 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -475,6 +475,10 @@ def cache_tree(tree_uuid: str): def send_mail(tree_uuid: str): if not enable_mail_notification: return redirect(url_for('tree', tree_uuid=tree_uuid)) + if request.form.get('name'): + # got a bot. + logging.info(f'{src_request_ip(request)} is a bot - {request.headers.get("User-Agent")}.') + return redirect('https://www.youtube.com/watch?v=iwGFalTRHDA') email: str = request.form['email'] if request.form.get('email') else '' if '@' not in email: # skip clearly incorrect emails diff --git a/website/web/static/generic.css b/website/web/static/generic.css index d1fa3ea2..8703fffa 100644 --- a/website/web/static/generic.css +++ b/website/web/static/generic.css @@ -85,3 +85,14 @@ table td p { padding: 5px; width: 150px; } + +/* boaty */ +.boatymcboat { + opacity: 0; + position: absolute; + top: 0; + left: 0; + height: 0; + width: 0; + z-index: -1; +} diff --git a/website/web/templates/tree.html b/website/web/templates/tree.html index 7a306c4f..e0357787 100644 --- a/website/web/templates/tree.html +++ b/website/web/templates/tree.html @@ -488,6 +488,11 @@
+ + + +