fixtures.py 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. }),
  17. ('default_timezone', {
  18. 'value': "utc",
  19. 'type': "string",
  20. 'input': "select",
  21. 'extra': {'choices': '#TZ#'},
  22. 'name': _("Default Timezone"),
  23. 'description': _("Used by guests, crawlers and newly registered users."),
  24. }),
  25. ('password_length', {
  26. 'value': 4,
  27. 'type': "integer",
  28. 'input': "text",
  29. 'extra': {'min': 1},
  30. 'separator': _("Users Passwords"),
  31. 'name': _("Minimum user password length"),
  32. }),
  33. ('password_complexity', {
  34. 'value': [],
  35. 'type': "array",
  36. 'input': "mlist",
  37. 'extra': {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
  38. 'name': _("Password Complexity"),
  39. }),
  40. ('password_lifetime', {
  41. 'value': 0,
  42. 'type': "integer",
  43. 'input': "text",
  44. 'extra': {'min': 0},
  45. 'name': _("Password Lifetime"),
  46. '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."),
  47. }),
  48. ('password_in_email', {
  49. 'value': False,
  50. 'type': "boolean",
  51. 'input': "yesno",
  52. 'name': _("Include User Password in Welcoming E-mail"),
  53. '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."),
  54. }),
  55. ),
  56. }),
  57. )
  58. def load_fixtures():
  59. load_settings_fixture(settings_fixtures)
  60. def update_fixtures():
  61. update_settings_fixture(settings_fixtures)