summaryrefslogtreecommitdiffstats
path: root/forum/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'forum/forms.py')
-rw-r--r--forum/forms.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/forum/forms.py b/forum/forms.py
index e9781dc9..52cf00cc 100644
--- a/forum/forms.py
+++ b/forum/forms.py
@@ -11,6 +11,7 @@ from django.contrib.contenttypes.models import ContentType
from forum.utils.forms import NextUrlField, UserNameField, SetPasswordForm
from recaptcha_django import ReCaptchaField
from django.conf import settings
+from forum.conf import settings as forum_settings
import logging
@@ -65,7 +66,7 @@ class TagNamesField(forms.CharField):
tag_strings = split_re.split(data)
out_tag_list = []
tag_count = len(tag_strings)
- if tag_count > const.MAX_TAGS_PER_POST:
+ if tag_count > forum_settings.MAX_TAGS_PER_POST:
msg = ungettext(
'please use %(tag_count)d tag or less',#odd but have to use to pluralize
'please use %(tag_count)d tags or less',
@@ -73,7 +74,7 @@ class TagNamesField(forms.CharField):
raise forms.ValidationError(msg)
for tag in tag_strings:
tag_length = len(tag)
- if tag_length > const.MAX_TAG_LENGTH:
+ if tag_length > forum_settings.MAX_TAG_LENGTH:
#singular form is odd in english, but required for pluralization
#in other languages
msg = ungettext('each tag must be shorter than %(max_chars)d character',#odd but added for completeness
@@ -97,7 +98,7 @@ class WikiField(forms.BooleanField):
self.label = _('community wiki')
self.help_text = _('if you choose community wiki option, the question and answer do not generate points and name of author will not be shown')
def clean(self,value):
- return value and settings.WIKI_ON
+ return value and forum_settings.WIKI_ON
class EmailNotifyField(forms.BooleanField):
def __init__(self, *args, **kwargs):
@@ -231,7 +232,7 @@ class AnswerForm(forms.Form):
def __init__(self, question, user, *args, **kwargs):
super(AnswerForm, self).__init__(*args, **kwargs)
self.fields['email_notify'].widget.attrs['id'] = 'question-subscribe-updates';
- if question.wiki and settings.WIKI_ON:
+ if question.wiki and forum_settings.WIKI_ON:
self.fields['wiki'].initial = True
if user.is_authenticated():
if user in question.followed_by.all():