|
@@ -1,5 +1,5 @@
|
|
from misago.monitor.fixtures import load_monitor_fixture
|
|
from misago.monitor.fixtures import load_monitor_fixture
|
|
-from misago.settings.fixtures import load_settings_fixture
|
|
|
|
|
|
+from misago.settings.fixtures import load_settings_fixture, update_settings_fixture
|
|
from misago.users.models import Rank
|
|
from misago.users.models import Rank
|
|
from misago.utils import ugettext_lazy as _
|
|
from misago.utils import ugettext_lazy as _
|
|
from misago.utils import get_msgid
|
|
from misago.utils import get_msgid
|
|
@@ -27,6 +27,7 @@ settings_fixtures = (
|
|
'separator': _("General Settings"),
|
|
'separator': _("General Settings"),
|
|
'name': _("Allowed Avatars"),
|
|
'name': _("Allowed Avatars"),
|
|
'description': _("Select Avatar types allowed on your forum."),
|
|
'description': _("Select Avatar types allowed on your forum."),
|
|
|
|
+ 'position': 0,
|
|
}),
|
|
}),
|
|
('default_avatar', {
|
|
('default_avatar', {
|
|
'value': "gravatar",
|
|
'value': "gravatar",
|
|
@@ -35,6 +36,7 @@ settings_fixtures = (
|
|
'extra': {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
|
|
'extra': {'choices': [('gravatar', _("Gravatar")), ('gallery', _("Random Avatar from Gallery"))]},
|
|
'name': _("Default Avatar"),
|
|
'name': _("Default Avatar"),
|
|
'description': _("Default Avatar assigned to new members. If you creade directory and name it \"_default\", forum will select random avatar from that directory instead of regular gallery. If no avatar can be picked from gallery, Gravatar will be used."),
|
|
'description': _("Default Avatar assigned to new members. If you creade directory and name it \"_default\", forum will select random avatar from that directory instead of regular gallery. If no avatar can be picked from gallery, Gravatar will be used."),
|
|
|
|
+ 'position': 1,
|
|
}),
|
|
}),
|
|
('upload_limit', {
|
|
('upload_limit', {
|
|
'value': 128,
|
|
'value': 128,
|
|
@@ -44,6 +46,7 @@ settings_fixtures = (
|
|
'separator': _("Avatar Upload Settings"),
|
|
'separator': _("Avatar Upload Settings"),
|
|
'name': _("Maxmimum size of uploaded file"),
|
|
'name': _("Maxmimum size of uploaded file"),
|
|
'description': _("Select maximum allowed file size (in KB) for Avatar uploads."),
|
|
'description': _("Select maximum allowed file size (in KB) for Avatar uploads."),
|
|
|
|
+ 'position': 2,
|
|
}),
|
|
}),
|
|
),
|
|
),
|
|
}),
|
|
}),
|
|
@@ -58,6 +61,7 @@ settings_fixtures = (
|
|
'extra': {'choices': [('', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]},
|
|
'extra': {'choices': [('', _("No validation required")), ('user', _("Activation Token sent to User")), ('admin', _("Activation by Administrator")), ('block', _("Dont allow new registrations"))]},
|
|
'separator': _("Users Registrations"),
|
|
'separator': _("Users Registrations"),
|
|
'name': _("New accounts validation"),
|
|
'name': _("New accounts validation"),
|
|
|
|
+ 'position': 0,
|
|
}),
|
|
}),
|
|
('default_timezone', {
|
|
('default_timezone', {
|
|
'value': "utc",
|
|
'value': "utc",
|
|
@@ -66,6 +70,7 @@ settings_fixtures = (
|
|
'extra': {'choices': '#TZ#'},
|
|
'extra': {'choices': '#TZ#'},
|
|
'name': _("Default Timezone"),
|
|
'name': _("Default Timezone"),
|
|
'description': _("Used by guests, crawlers and newly registered users."),
|
|
'description': _("Used by guests, crawlers and newly registered users."),
|
|
|
|
+ 'position': 1,
|
|
}),
|
|
}),
|
|
('password_length', {
|
|
('password_length', {
|
|
'value': 4,
|
|
'value': 4,
|
|
@@ -74,6 +79,7 @@ settings_fixtures = (
|
|
'extra': {'min': 1},
|
|
'extra': {'min': 1},
|
|
'separator': _("Users Passwords"),
|
|
'separator': _("Users Passwords"),
|
|
'name': _("Minimum user password length"),
|
|
'name': _("Minimum user password length"),
|
|
|
|
+ 'position': 2,
|
|
}),
|
|
}),
|
|
('password_complexity', {
|
|
('password_complexity', {
|
|
'value': [],
|
|
'value': [],
|
|
@@ -81,6 +87,7 @@ settings_fixtures = (
|
|
'input': "mlist",
|
|
'input': "mlist",
|
|
'extra': {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
|
|
'extra': {'choices': [('case', _("Require mixed Case")), ('digits', _("Require digits")), ('special', _("Require special characters"))]},
|
|
'name': _("Password Complexity"),
|
|
'name': _("Password Complexity"),
|
|
|
|
+ 'position': 3,
|
|
}),
|
|
}),
|
|
('password_lifetime', {
|
|
('password_lifetime', {
|
|
'value': 0,
|
|
'value': 0,
|
|
@@ -89,6 +96,7 @@ settings_fixtures = (
|
|
'extra': {'min': 0},
|
|
'extra': {'min': 0},
|
|
'name': _("Password Lifetime"),
|
|
'name': _("Password Lifetime"),
|
|
'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."),
|
|
'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."),
|
|
|
|
+ 'position': 4,
|
|
}),
|
|
}),
|
|
('sessions_hidden', {
|
|
('sessions_hidden', {
|
|
'value': True,
|
|
'value': True,
|
|
@@ -97,6 +105,7 @@ settings_fixtures = (
|
|
'separator': _("Sessions Settings"),
|
|
'separator': _("Sessions Settings"),
|
|
'name': _("Allow hidden sessions"),
|
|
'name': _("Allow hidden sessions"),
|
|
'description': _("Enabling this option will allow users to hide their presence on forums from other members."),
|
|
'description': _("Enabling this option will allow users to hide their presence on forums from other members."),
|
|
|
|
+ 'position': 5,
|
|
}),
|
|
}),
|
|
('sessions_validate_ip', {
|
|
('sessions_validate_ip', {
|
|
'value': True,
|
|
'value': True,
|
|
@@ -104,6 +113,7 @@ settings_fixtures = (
|
|
'input': "yesno",
|
|
'input': "yesno",
|
|
'name': _("Check IP on session authorization"),
|
|
'name': _("Check IP on session authorization"),
|
|
'description': _("Makes sessions more secure, but can cause problems with proxies and VPN's."),
|
|
'description': _("Makes sessions more secure, but can cause problems with proxies and VPN's."),
|
|
|
|
+ 'position': 6,
|
|
}),
|
|
}),
|
|
('remember_me_allow', {
|
|
('remember_me_allow', {
|
|
'value': True,
|
|
'value': True,
|
|
@@ -112,6 +122,7 @@ settings_fixtures = (
|
|
'separator': _("Sign-In Settings"),
|
|
'separator': _("Sign-In Settings"),
|
|
'name': _('Enable "Remember Me" functionality'),
|
|
'name': _('Enable "Remember Me" functionality'),
|
|
'description': _("Turning this option on allows users to sign in on to your board using cookie-based tokens. This may result in account compromisation when user fails to sign out on shared computer."),
|
|
'description': _("Turning this option on allows users to sign in on to your board using cookie-based tokens. This may result in account compromisation when user fails to sign out on shared computer."),
|
|
|
|
+ 'position': 7,
|
|
}),
|
|
}),
|
|
('remember_me_lifetime', {
|
|
('remember_me_lifetime', {
|
|
'value': 90,
|
|
'value': 90,
|
|
@@ -126,6 +137,7 @@ settings_fixtures = (
|
|
'input': "yesno",
|
|
'input': "yesno",
|
|
'name': _('Allow "Remember Me" tokens refreshing'),
|
|
'name': _('Allow "Remember Me" tokens refreshing'),
|
|
'description': _('Set this setting to off if you want to force your users to periodically update their "Remember Me" tokens by signing in. If this option is on, Tokens are updated when they are used to open new session.'),
|
|
'description': _('Set this setting to off if you want to force your users to periodically update their "Remember Me" tokens by signing in. If this option is on, Tokens are updated when they are used to open new session.'),
|
|
|
|
+ 'position': 8,
|
|
}),
|
|
}),
|
|
('login_attempts_limit', {
|
|
('login_attempts_limit', {
|
|
'value': 3,
|
|
'value': 3,
|
|
@@ -135,6 +147,7 @@ settings_fixtures = (
|
|
'separator': _("Brute-Force Countermeasures"),
|
|
'separator': _("Brute-Force Countermeasures"),
|
|
'name': _("Limit Sign In attempts"),
|
|
'name': _("Limit Sign In attempts"),
|
|
'description': _('Enter maximal number of allowed Sign In attempts before IP address "jams".'),
|
|
'description': _('Enter maximal number of allowed Sign In attempts before IP address "jams".'),
|
|
|
|
+ 'position': 9,
|
|
}),
|
|
}),
|
|
('registrations_jams', {
|
|
('registrations_jams', {
|
|
'value': 1,
|
|
'value': 1,
|
|
@@ -143,6 +156,7 @@ settings_fixtures = (
|
|
'input': "yesno",
|
|
'input': "yesno",
|
|
'name': _("Count failed register attempts too"),
|
|
'name': _("Count failed register attempts too"),
|
|
'description': _("Set this setting to yes if you want failed register attempts to count into limit."),
|
|
'description': _("Set this setting to yes if you want failed register attempts to count into limit."),
|
|
|
|
+ 'position': 10,
|
|
}),
|
|
}),
|
|
('jams_lifetime', {
|
|
('jams_lifetime', {
|
|
'value': 15,
|
|
'value': 15,
|
|
@@ -151,12 +165,14 @@ settings_fixtures = (
|
|
'input': "text",
|
|
'input': "text",
|
|
'name': _("Automaticaly unlock jammed IPs"),
|
|
'name': _("Automaticaly unlock jammed IPs"),
|
|
'description': _('Enter number of minutes since IP address "jams" to automatically unlock it, or 0 to never unlock jammed IP adresses. Jams dont count as bans.'),
|
|
'description': _('Enter number of minutes since IP address "jams" to automatically unlock it, or 0 to never unlock jammed IP adresses. Jams dont count as bans.'),
|
|
|
|
+ 'position': 11,
|
|
}),
|
|
}),
|
|
),
|
|
),
|
|
}),
|
|
}),
|
|
)
|
|
)
|
|
|
|
|
|
-def load_fixture():
|
|
|
|
|
|
+
|
|
|
|
+def load_fixtures():
|
|
load_monitor_fixture(monitor_fixtures)
|
|
load_monitor_fixture(monitor_fixtures)
|
|
load_settings_fixture(settings_fixtures)
|
|
load_settings_fixture(settings_fixtures)
|
|
|
|
|
|
@@ -191,4 +207,8 @@ def load_fixture():
|
|
rank_staff.save(force_insert=True)
|
|
rank_staff.save(force_insert=True)
|
|
rank_lurker.save(force_insert=True)
|
|
rank_lurker.save(force_insert=True)
|
|
rank_member.save(force_insert=True)
|
|
rank_member.save(force_insert=True)
|
|
- rank_active.save(force_insert=True)
|
|
|
|
|
|
+ rank_active.save(force_insert=True)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+def update_fixtures():
|
|
|
|
+ update_settings_fixture(settings_fixtures)
|