Add hcaptcha support and .env file
hcaptcha can be turned on in settings.py with parameters in the .env file Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from django.conf import settings
|
||||
from django.forms import ModelForm
|
||||
from board.models import Post
|
||||
from hcaptcha.fields import hCaptchaField
|
||||
|
||||
|
||||
class PostForm(ModelForm):
|
||||
@@ -9,6 +11,8 @@ class PostForm(ModelForm):
|
||||
This requires the board and the IP address to be specified.
|
||||
"""
|
||||
|
||||
hcaptcha = hCaptchaField() if settings.USE_HCAPTCHA else None
|
||||
|
||||
class Meta:
|
||||
model = Post
|
||||
fields = ["subject", "name", "text", "image"]
|
||||
@@ -27,6 +31,8 @@ class ReplyForm(PostForm):
|
||||
specified.
|
||||
"""
|
||||
|
||||
hcaptcha = hCaptchaField() if settings.USE_HCAPTCHA else None
|
||||
|
||||
class Meta:
|
||||
model = Post
|
||||
fields = ["name", "text", "bump", "image"]
|
||||
|
||||
Reference in New Issue
Block a user