from general import NextUrlField, UserNameField, UserEmailField, SetPasswordForm
from forum.models import Question, User
+from forum.settings import INITIAL_EMAIL_SUBSCRIBE_OPTION
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
)
subscribe = forms.ChoiceField(widget=forms.widgets.RadioSelect(), \
error_messages={'required':_('please choose one of the options above')},
- choices=SIMPLE_SUBSCRIBE_CHOICES)
+ choices=SIMPLE_SUBSCRIBE_CHOICES, initial=INITIAL_EMAIL_SUBSCRIBE_OPTION)
class ChangePasswordForm(SetPasswordForm):
from base import Setting, SettingSet\r
from django.utils.translation import ugettext_lazy as _\r
from django.forms.widgets import PasswordInput\r
+from django.forms.widgets import RadioSelect\r
\r
EMAIL_SET = SettingSet('email', _('Email settings'), _("Email server and other email related settings."), 50)\r
\r
+EMAIL_SUBSCRIBE_CHOICES = (\r
+ ('y', _('Users are subscribed by default')),\r
+ ('n', _('Users are not subscribed by default')),\r
+)\r
+\r
+INITIAL_EMAIL_SUBSCRIBE_OPTION = Setting('INITIAL_EMAIL_SUBSCRIBE_OPTION', 'y', EMAIL_SET, dict(\r
+label = _("Default email subscription "),\r
+widget=RadioSelect,\r
+choices=EMAIL_SUBSCRIBE_CHOICES,\r
+help_text = _("Choose what should be the default email subscription status while registering."),\r
+required=False))\r
+\r
EMAIL_HOST = Setting('EMAIL_HOST', '', EMAIL_SET, dict(\r
label = _("Email Server"),\r
help_text = _("The SMTP server through which your application will be sending emails."),\r