diff --git a/web/forms.py b/web/forms.py index 96489d524..b4799c7dd 100644 --- a/web/forms.py +++ b/web/forms.py @@ -578,6 +578,8 @@ def clean(self): class ReviewForm(forms.ModelForm): + captcha = CaptchaField(widget=TailwindCaptchaTextInput) + class Meta: model = Review fields = ("rating", "comment") @@ -910,6 +912,7 @@ class SuccessStoryForm(forms.ModelForm): content = MarkdownxFormField( label="Content", help_text="Use markdown for formatting. You can use **bold**, *italic*, lists, etc." ) + captcha = CaptchaField(widget=TailwindCaptchaTextInput) class Meta: model = SuccessStory @@ -929,6 +932,8 @@ class Meta: class LearnForm(forms.ModelForm): """Form for creating and editing waiting rooms.""" + captcha = CaptchaField(widget=TailwindCaptchaTextInput) + class Meta: model = WaitingRoom fields = ["title", "description", "subject", "topics"] @@ -1254,6 +1259,7 @@ class ForumTopicForm(forms.Form): widget=TailwindURLInput(attrs={"placeholder": "https://github.com/your-org/your-repo/milestone/1"}), help_text="Link to a related GitHub milestone (optional)", ) + captcha = CaptchaField(widget=TailwindCaptchaTextInput) def clean_github_issue_url(self): url = self.cleaned_data.get("github_issue_url") @@ -1308,6 +1314,8 @@ class Meta: class BlogPostForm(forms.ModelForm): """Form for creating and editing blog posts.""" + captcha = CaptchaField(widget=TailwindCaptchaTextInput) + class Meta: model = BlogPost fields = ["title", "content", "excerpt", "featured_image", "status", "tags"] @@ -1664,6 +1672,7 @@ class MemeForm(forms.ModelForm): ), help_text="If your subject isn't listed, enter a new one here", ) + captcha = CaptchaField(widget=TailwindCaptchaTextInput) class Meta: model = Meme @@ -1902,6 +1911,8 @@ class Meta: class StudyGroupForm(forms.ModelForm): + captcha = CaptchaField(widget=TailwindCaptchaTextInput) + class Meta: model = StudyGroup fields = ["name", "description", "course", "max_members", "is_private"] @@ -1915,6 +1926,7 @@ class VideoRequestForm(forms.ModelForm): # Only allow href, title and target attributes on anchor tags for security "a": ["href", "title", "target"], } + captcha = CaptchaField(widget=TailwindCaptchaTextInput) class Meta: model = VideoRequest @@ -1965,6 +1977,7 @@ class SurveyForm(forms.ModelForm): widget=TailwindInput(attrs={"placeholder": "Enter survey title"}), help_text="Give your survey a clear and descriptive title", ) + captcha = CaptchaField(widget=TailwindCaptchaTextInput) class Meta: model = Survey diff --git a/web/templates/add_meme.html b/web/templates/add_meme.html index e7c12a71e..89ffab297 100644 --- a/web/templates/add_meme.html +++ b/web/templates/add_meme.html @@ -65,6 +65,8 @@
@@ -72,6 +74,14 @@
{{ form.captcha.errors.0 }}
+ {% endif %} +{{ error }}
{% endfor %} diff --git a/web/templates/success_stories/create.html b/web/templates/success_stories/create.html index e2fb282d6..18cffe566 100644 --- a/web/templates/success_stories/create.html +++ b/web/templates/success_stories/create.html @@ -106,6 +106,15 @@{{ form.captcha.errors }}
+ {% endif %} +