]> git.openstreetmap.org Git - osqa.git/blob - forum/settings/users.py
Fixes OSQA-372 "Show status diamonds" option cannot be turned off.
[osqa.git] / forum / settings / users.py
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 _
5
6 USERS_SET = SettingSet('users', _('Users settings'), _("General settings for the OSQA users."), 20)
7
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."),
11 required=False))
12
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.")))
16
17 RESERVED_USERNAMES = Setting('RESERVED_USERNAMES',
18 [_('fuck'), _('shit'), _('ass'), _('sex'), _('add'), _('edit'), _('save'), _('delete'), _('manage'), _('update'), _('remove'), _('new')]
19 , USERS_SET, dict(
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))
23
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."),
27 required=False,
28 ))
29
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.")))
33
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"))),
39 required=False,
40 ))
41
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.")
45 ))
46
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.")
50 ))
51