1 from forms import CommaStringListWidget
2 from django.forms import CheckboxSelectMultiple
3 from base import Setting, SettingSet
4 from django.utils.translation import ugettext as _
6 USERS_SET = SettingSet('users', _('Users settings'), _("General settings for the OSQA users."), 20)
8 EDITABLE_SCREEN_NAME = Setting('EDITABLE_SCREEN_NAME', False, USERS_SET, dict(
9 label = _("Editable screen name"),
10 help_text = _("Allow users to alter their screen name."),
13 MIN_USERNAME_LENGTH = Setting('MIN_USERNAME_LENGTH', 3, USERS_SET, dict(
14 label = _("Minimum username length"),
15 help_text = _("The minimum length (in character) of a username.")))
17 RESERVED_USERNAMES = Setting('RESERVED_USERNAMES',
18 [_('fuck'), _('shit'), _('ass'), _('sex'), _('add'), _('edit'), _('save'), _('delete'), _('manage'), _('update'), _('remove'), _('new')]
20 label = _("Disabled usernames"),
21 help_text = _("A comma separated list of disabled usernames (usernames not allowed during a new user registration)."),
22 widget=CommaStringListWidget))
24 SHOW_STATUS_DIAMONDS = Setting('SHOW_STATUS_DIAMONDS', True, USERS_SET, dict(
25 label=_("Show status diamonds"),
26 help_text = _("Show status \"diamonds\" next to moderators or superusers usernames."),
30 EMAIL_UNIQUE = Setting('EMAIL_UNIQUE', True, USERS_SET, dict(
31 label = _("Force unique email"),
32 help_text = _("Should each user have an unique email.")))
34 REQUIRE_EMAIL_VALIDATION_TO = Setting('REQUIRE_EMAIL_VALIDATION_TO', [], USERS_SET, dict(
35 label = _("Require email validation to..."),
36 help_text = _("Which actions in this site, users without a valid email will be prevented from doing."),
37 widget=CheckboxSelectMultiple,
38 choices=(("ask", _("ask questions")), ("answer", _("provide answers")), ("comment", _("make comments")), ("flag", _("report posts"))),
42 HOLD_PENDING_POSTS_MINUTES = Setting('HOLD_PENDING_POSTS_MINUTES', 120, USERS_SET, dict(
43 label=_("Hold pending posts for X minutes"),
44 help_text=_("How much time in minutes a post should be kept in session until the user logs in or validates the email.")
47 WARN_PENDING_POSTS_MINUTES = Setting('WARN_PENDING_POSTS_MINUTES', 15, USERS_SET, dict(
48 label=_("Warn about pending posts afer X minutes"),
49 help_text=_("How much time in minutes a user that just logged in or validated his email should be warned about a pending post instead of publishing it automatically.")