fixtures.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
  2. from misago.utils import ugettext_lazy as _
  3. from misago.utils import get_msgid
  4. settings_fixtures = (
  5. # Register and Sign-In Settings
  6. ('accounts', {
  7. 'name': _("Users Accounts Settings"),
  8. 'description': _("Those settings allow you to increase security of your members accounts."),
  9. 'settings': (
  10. ('account_activation', {
  11. 'type': "string",
  12. 'input': "choice",
  13. 'extra': {'choices': [('', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]},
  14. 'separator': _("Users Registrations"),
  15. 'name': _("New accounts validation"),
  16. 'position': 0,
  17. }),
  18. ('default_timezone', {
  19. 'value': "utc",
  20. 'type': "string",
  21. 'input': "select",
  22. 'extra': {'choices': '#TZ#'},
  23. 'name': _("Default Timezone"),
  24. 'description': _("Used by guests, crawlers and newly registered users."),
  25. 'position': 1,
  26. }),
  27. ('password_length', {
  28. 'value': 4,
  29. 'type': "integer",
  30. 'input': "text",
  31. 'extra': {'min': 1},
  32. 'separator': _("Users Passwords"),
  33. 'name': _("Minimum user password length"),
  34. 'position': 2,
  35. }),
  36. ('password_complexity', {
  37. 'value': [],
  38. 'type': "array",
  39. 'input': "mlist",
  40. 'extra': {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
  41. 'name': _("Password Complexity"),
  42. 'position': 3,
  43. }),
  44. ('password_lifetime', {
  45. 'value': 0,
  46. 'type': "integer",
  47. 'input': "text",
  48. 'extra': {'min': 0},
  49. 'name': _("Password Lifetime"),
  50. 'description': _("Enter number of days since password was set to force member to change it with new one, or 0 to dont force your members to change their passwords."),
  51. 'position': 4,
  52. }),
  53. ('password_in_email', {
  54. 'value': False,
  55. 'type': "boolean",
  56. 'input': "yesno",
  57. 'name': _("Include User Password in Welcoming E-mail"),
  58. 'description': _("If you want to, Misago can include new user password in welcoming e-mail that is sent to new users after successful account creation."),
  59. 'position': 5,
  60. }),
  61. ),
  62. }),
  63. )
  64. def load_fixtures():
  65. load_settings_fixture(settings_fixtures)
  66. def update_fixtures():
  67. update_settings_fixture(settings_fixtures)