Code reformatted using black

This commit is contained in:
Antoine Nguyen
2024-02-20 21:45:07 +01:00
parent 0000e4f4a7
commit 89cc0cf2a3
347 changed files with 9678 additions and 7970 deletions
+162 -124
View File
@@ -19,7 +19,7 @@ class ParametersForm(param_forms.AdminParametersForm):
enable_admin_limits = YesNoField(
label=_("Enable per-admin limits"),
initial=True,
help_text=_("Enable or disable per-admin limits")
help_text=_("Enable or disable per-admin limits"),
)
deflt_user_domain_admins_limit = forms.IntegerField(
@@ -30,8 +30,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"administrator. (0 to deny any creation, -1 to allow unlimited "
"creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_user_domains_limit = forms.IntegerField(
label=_("Domains"),
@@ -40,8 +39,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"Maximum number of allowed domains for a new administrator. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_user_domain_aliases_limit = forms.IntegerField(
label=_("Domain aliases"),
@@ -51,8 +49,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_user_mailboxes_limit = forms.IntegerField(
label=_("Mailboxes"),
@@ -61,8 +58,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"Maximum number of allowed mailboxes for a new administrator. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_user_mailbox_aliases_limit = forms.IntegerField(
label=_("Mailbox aliases"),
@@ -71,8 +67,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"Maximum number of allowed aliases for a new administrator. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_user_quota_limit = forms.IntegerField(
label=_("Quota"),
@@ -81,8 +76,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"The quota a reseller will be allowed to share between the "
"domains he creates. (0 means no quota)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
domain_limits_sep = SeparatorField(label=_("Default per-domain limits"))
@@ -90,7 +84,7 @@ class ParametersForm(param_forms.AdminParametersForm):
enable_domain_limits = YesNoField(
label=_("Enable per-domain limits"),
initial=False,
help_text=_("Enable or disable per-domain limits")
help_text=_("Enable or disable per-domain limits"),
)
deflt_domain_domain_admins_limit = forms.IntegerField(
@@ -101,8 +95,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"domain. (0 to deny any creation, -1 to allow unlimited "
"creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_domain_domain_aliases_limit = forms.IntegerField(
label=_("Domain aliases"),
@@ -112,8 +105,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"domain. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_domain_mailboxes_limit = forms.IntegerField(
label=_("Mailboxes"),
@@ -122,8 +114,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"Maximum number of allowed mailboxes for a new domain. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
deflt_domain_mailbox_aliases_limit = forms.IntegerField(
label=_("Mailbox aliases"),
@@ -132,8 +123,7 @@ class ParametersForm(param_forms.AdminParametersForm):
"Maximum number of allowed aliases for a new domain. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
widget=forms.widgets.TextInput(
attrs={"class": "col-md-1 form-control"})
widget=forms.widgets.TextInput(attrs={"class": "col-md-1 form-control"}),
)
visibility_rules = {
@@ -149,107 +139,155 @@ class ParametersForm(param_forms.AdminParametersForm):
}
GLOBAL_PARAMETERS_STRUCT = collections.OrderedDict([
("per_admin_limits", {
"label": _("Default per-admin limits"),
"params": collections.OrderedDict([
("enable_admin_limits", {
"label": _("Enable per-admin limits"),
"help_text": _("Enable or disable per-admin limits")
}),
("deflt_user_domain_admins_limit", {
"label": _("Domain admins"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed domain administrators for a new "
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
GLOBAL_PARAMETERS_STRUCT = collections.OrderedDict(
[
(
"per_admin_limits",
{
"label": _("Default per-admin limits"),
"params": collections.OrderedDict(
[
(
"enable_admin_limits",
{
"label": _("Enable per-admin limits"),
"help_text": _("Enable or disable per-admin limits"),
},
),
(
"deflt_user_domain_admins_limit",
{
"label": _("Domain admins"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed domain administrators for a new "
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
},
),
(
"deflt_user_domains_limit",
{
"label": _("Domains"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed domains for a new administrator."
" (0 to deny any creation, -1 to allow unlimited creations)"
),
},
),
(
"deflt_user_domain_aliases_limit",
{
"label": _("Domain aliases"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed domain aliases for a new "
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
},
),
(
"deflt_user_mailboxes_limit",
{
"label": _("Mailboxes"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed mailboxes for a new "
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
},
),
(
"deflt_user_mailbox_aliases_limit",
{
"label": _("Mailbox aliases"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed aliases for a new administrator."
" (0 to deny any creation, -1 to allow unlimited creations)"
),
},
),
(
"deflt_user_quota_limit",
{
"label": _("Quota"),
"help_text": _(
"The quota a reseller will be allowed to share between the "
"domains he creates. (0 means no quota)"
),
},
),
]
),
}),
("deflt_user_domains_limit", {
"label": _("Domains"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed domains for a new administrator."
" (0 to deny any creation, -1 to allow unlimited creations)"
},
),
(
"per_domain_limits",
{
"label": _("Default per-domain limits"),
"params": collections.OrderedDict(
[
(
"enable_domain_limits",
{
"label": _("Enable per-domain limits"),
"help_text": _("Enable or disable per-domain limits"),
},
),
(
"deflt_domain_domain_admins_limit",
{
"label": _("Domain admins"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed domain administrators for a new "
"domain. (0 to deny any creation, -1 to allow unlimited "
"creations)"
),
},
),
(
"deflt_domain_domain_aliases_limit",
{
"label": _("Domain aliases"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed domain aliases for a new "
"domain. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
},
),
(
"deflt_domain_mailboxes_limit",
{
"label": _("Mailboxes"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed mailboxes for a new domain. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
},
),
(
"deflt_domain_mailbox_aliases_limit",
{
"label": _("Mailbox aliases"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed aliases for a new domain. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
},
),
]
),
}),
("deflt_user_domain_aliases_limit", {
"label": _("Domain aliases"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed domain aliases for a new "
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
}),
("deflt_user_mailboxes_limit", {
"label": _("Mailboxes"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed mailboxes for a new "
"administrator. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
}),
("deflt_user_mailbox_aliases_limit", {
"label": _("Mailbox aliases"),
"display": "enable_admin_limits=true",
"help_text": _(
"Maximum number of allowed aliases for a new administrator."
" (0 to deny any creation, -1 to allow unlimited creations)"
),
}),
("deflt_user_quota_limit", {
"label": _("Quota"),
"help_text": _(
"The quota a reseller will be allowed to share between the "
"domains he creates. (0 means no quota)"
),
})
])
}),
("per_domain_limits", {
"label": _("Default per-domain limits"),
"params": collections.OrderedDict([
("enable_domain_limits", {
"label": _("Enable per-domain limits"),
"help_text": _("Enable or disable per-domain limits")
}),
("deflt_domain_domain_admins_limit", {
"label": _("Domain admins"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed domain administrators for a new "
"domain. (0 to deny any creation, -1 to allow unlimited "
"creations)"
),
}),
("deflt_domain_domain_aliases_limit", {
"label": _("Domain aliases"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed domain aliases for a new "
"domain. (0 to deny any creation, -1 to allow "
"unlimited creations)"
),
}),
("deflt_domain_mailboxes_limit", {
"label": _("Mailboxes"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed mailboxes for a new domain. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
}),
("deflt_domain_mailbox_aliases_limit", {
"label": _("Mailbox aliases"),
"display": "enable_domain_limits=true",
"help_text": _(
"Maximum number of allowed aliases for a new domain. "
"(0 to deny any creation, -1 to allow unlimited creations)"
),
})
])
})
])
},
),
]
)