fixtures.py 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. # Spam Countermeasures
  6. ('spam', {
  7. 'name': _("Spam Countermeasures"),
  8. 'description': _("Those settings allow you to combat automatic registrations and spam messages on your forum."),
  9. 'settings': (
  10. ('bots_registration', {
  11. 'type': "string",
  12. 'input': "choice",
  13. 'extra': {'choices': [('', _("No protection")), ('recaptcha', _("reCaptcha")), ('qa', _("Question & Answer"))]},
  14. 'separator': _("Spambots Registrations"),
  15. 'name': _("CAPTCHA type"),
  16. 'description': _('CAPTCHA stands for "Completely Automated Public Turing test to tell Computers and Humans Apart". Its type of test developed on purpose of blocking automatic registrations.'),
  17. 'position': 0,
  18. }),
  19. ('recaptcha_public', {
  20. 'type': "string",
  21. 'input': "text",
  22. 'separator': _("reCaptcha"),
  23. 'name': _("Public Key"),
  24. 'description': _("Enter public API key that you have received from reCaptcha."),
  25. 'position': 1,
  26. }),
  27. ('recaptcha_private', {
  28. 'type': "string",
  29. 'input': "text",
  30. 'name': _("Private Key"),
  31. 'description': _("Enter private API key that you have received from reCaptcha."),
  32. 'position': 2,
  33. }),
  34. ('recaptcha_ssl', {
  35. 'value': False,
  36. 'type': "boolean",
  37. 'input': "yesno",
  38. 'name': _("Use SSL in reCaptcha"),
  39. 'description': _("Do you want forum to use SSL when making requests to reCaptha servers?"),
  40. 'position': 3,
  41. }),
  42. ('qa_test', {
  43. 'type': "string",
  44. 'input': "text",
  45. 'separator': _("Question and Answer Test"),
  46. 'name': _("Question"),
  47. 'description': _("Question visible to your users."),
  48. 'position': 4,
  49. }),
  50. ('qa_test_help', {
  51. 'type': "string",
  52. 'input': "text",
  53. 'name': _("Help Message"),
  54. 'description': _("Optional help message displayed on form."),
  55. 'position': 5,
  56. }),
  57. ('qa_test_answers', {
  58. 'type': "string",
  59. 'input': "textarea",
  60. 'name': _("Answers"),
  61. 'description': _("Enter allowed answers to this question, each in new line. Test is case-insensitive."),
  62. 'position': 6,
  63. }),
  64. ),
  65. }),
  66. )
  67. def load_fixtures():
  68. load_settings_fixture(settings_fixtures)
  69. def update_fixtures():
  70. update_settings_fixture(settings_fixtures)