Fix report form to use appropriate templates
Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
from django.conf import settings
|
||||
from django.db import transaction
|
||||
from django.forms import ModelForm
|
||||
from board.models import Post, Report, ReportRecord
|
||||
from django.db.models import Q
|
||||
from django.forms import ModelForm, ModelChoiceField
|
||||
from board.models import Post, Report, ReportReason, ReportRecord
|
||||
from hcaptcha.fields import hCaptchaField
|
||||
|
||||
|
||||
@@ -61,6 +62,8 @@ class ReportForm(ModelForm):
|
||||
super(ReportForm, self).__init__(*args, **kwargs)
|
||||
self.instance.ip = ip
|
||||
self.op = op
|
||||
queryset = ReportReason.objects.filter(Q(board=None) | Q(board=board))
|
||||
self.fields["reason"] = ModelChoiceField(queryset=queryset)
|
||||
|
||||
def clean(self):
|
||||
# Get or create the record before creating the model
|
||||
|
||||
Reference in New Issue
Block a user