commit 28222dbd654405c8b1a3f94f34815a72577747b5
parent d597321a76af29356074ac502cf5dd28ba70b22f
Author: parazyd <parazyd@dyne.org>
Date: Sat, 19 Jan 2019 21:51:09 +0100
Try to avoid spambots.
Diffstat:
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/diaspora.py b/diaspora.py
@@ -43,6 +43,9 @@ def write():
if request.method != 'POST':
return render_template('write.html')
+ if request.form['42']:
+ return render_template('fail_write.html')
+
delkey = randomstring(32)
storyargs = [
None,
diff --git a/templates/fail_write.html b/templates/fail_write.html
@@ -0,0 +1,15 @@
+{% include 'header.html' %}
+
+ <title>Fail! | Diaspora Diaries</title>
+
+{% include 'nav.html' %}
+
+ <main role="main" class="container cover">
+
+ <h1 class="cover-heading">Error!</h1>
+
+ <p class="lead">Are you a robot?</p>
+
+ </main>
+
+{% include 'footer.html' %}
diff --git a/templates/write.html b/templates/write.html
@@ -20,7 +20,7 @@
<main role="main" class="container">
- <form action="/submit" method="POST" id="storyform">
+ <form action="/write" method="POST" id="storyform">
<p class="lead">Name:<br>
<input type="text" name="Name" required placeholder="Name">
</p>
@@ -40,13 +40,15 @@
</p>
<p class="lead">City of the story:<br>
- <input type="city" name="City" placeholder="City (optional)">
+ <input type="text" name="City" placeholder="City (optional)">
</p>
<p class="lead">Email:<br>
<input type="email" name="Email" placeholder="Email (optional)">
</p>
+ <input type="text" name="42" placeholder="Yeah sure" style="display: none;">
+
<p class="lead">Write your story:<br>
<textarea id="storytext" name="Story" form="storyform" required></textarea>
</p>