Show More
@@ -48,6 +48,9 b' class PostForm(NeboardForm):' | |||||
48 | text = forms.CharField(widget=forms.Textarea, required=False) |
|
48 | text = forms.CharField(widget=forms.Textarea, required=False) | |
49 | image = forms.ImageField(required=False) |
|
49 | image = forms.ImageField(required=False) | |
50 |
|
50 | |||
|
51 | # This field is for spam prevention only | |||
|
52 | email = forms.CharField(max_length=100, required=False) | |||
|
53 | ||||
51 | session = None |
|
54 | session = None | |
52 |
|
55 | |||
53 | def clean_title(self): |
|
56 | def clean_title(self): | |
@@ -80,6 +83,9 b' class PostForm(NeboardForm):' | |||||
80 | def clean(self): |
|
83 | def clean(self): | |
81 | cleaned_data = super(PostForm, self).clean() |
|
84 | cleaned_data = super(PostForm, self).clean() | |
82 |
|
85 | |||
|
86 | if cleaned_data['email']: | |||
|
87 | raise forms.ValidationError('A human cannot enter a hidden field') | |||
|
88 | ||||
83 | if not self.errors: |
|
89 | if not self.errors: | |
84 | self._clean_text_image() |
|
90 | self._clean_text_image() | |
85 |
|
91 | |||
@@ -206,4 +212,4 b' class LoginForm(NeboardForm):' | |||||
206 | def clean(self): |
|
212 | def clean(self): | |
207 | cleaned_data = super(LoginForm, self).clean() |
|
213 | cleaned_data = super(LoginForm, self).clean() | |
208 |
|
214 | |||
209 | return cleaned_data No newline at end of file |
|
215 | return cleaned_data |
@@ -304,4 +304,8 b' input[type="submit"]:hover {' | |||||
304 |
|
304 | |||
305 | .role { |
|
305 | .role { | |
306 | text-decoration: underline; |
|
306 | text-decoration: underline; | |
307 | } No newline at end of file |
|
307 | } | |
|
308 | ||||
|
309 | .form-email { | |||
|
310 | display: none; | |||
|
311 | } |
@@ -301,4 +301,8 b' input[type="submit"]:hover {' | |||||
301 |
|
301 | |||
302 | .role { |
|
302 | .role { | |
303 | text-decoration: underline; |
|
303 | text-decoration: underline; | |
304 | } No newline at end of file |
|
304 | } | |
|
305 | ||||
|
306 | .form-email { | |||
|
307 | display: none; | |||
|
308 | } |
@@ -284,4 +284,8 b' li {' | |||||
284 |
|
284 | |||
285 | .role { |
|
285 | .role { | |
286 | text-decoration: underline; |
|
286 | text-decoration: underline; | |
287 | } No newline at end of file |
|
287 | } | |
|
288 | ||||
|
289 | .form-email { | |||
|
290 | display: none; | |||
|
291 | } |
@@ -151,6 +151,11 b'' | |||||
151 | <div class="form-input">{{ form.tags }}</div> |
|
151 | <div class="form-input">{{ form.tags }}</div> | |
152 | <div class="form-errors">{{ form.tags.errors }}</div> |
|
152 | <div class="form-errors">{{ form.tags.errors }}</div> | |
153 | </div> |
|
153 | </div> | |
|
154 | <div class="form-row form-email"> | |||
|
155 | <div class="form-label">{% trans 'e-mail' %}</div> | |||
|
156 | <div class="form-input">{{ form.email }}</div> | |||
|
157 | <div class="form-errors">{{ form.email.errors }}</div> | |||
|
158 | </div> | |||
154 | <div class="form-row"> |
|
159 | <div class="form-row"> | |
155 | {{ form.captcha }} |
|
160 | {{ form.captcha }} | |
156 | <div class="form-errors">{{ form.captcha.errors }}</div> |
|
161 | <div class="form-errors">{{ form.captcha.errors }}</div> |
@@ -91,6 +91,11 b'' | |||||
91 | <div class="form-input">{{ form.image }}</div> |
|
91 | <div class="form-input">{{ form.image }}</div> | |
92 | <div class="form-errors">{{ form.image.errors }}</div> |
|
92 | <div class="form-errors">{{ form.image.errors }}</div> | |
93 | </div> |
|
93 | </div> | |
|
94 | <div class="form-row form-email"> | |||
|
95 | <div class="form-label">{% trans 'e-mail' %}</div> | |||
|
96 | <div class="form-input">{{ form.email }}</div> | |||
|
97 | <div class="form-errors">{{ form.email.errors }}</div> | |||
|
98 | </div> | |||
94 | <div class="form-row"> |
|
99 | <div class="form-row"> | |
95 | {{ form.captcha }} |
|
100 | {{ form.captcha }} | |
96 | <div class="form-errors">{{ form.captcha.errors }}</div> |
|
101 | <div class="form-errors">{{ form.captcha.errors }}</div> |
General Comments 0
You need to be logged in to leave comments.
Login now