8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-05-20 09:32:29 +00:00

Mark strings for translation in users

This commit is contained in:
Laouen Fernet 2019-11-20 00:52:11 +00:00 committed by chirac
parent 207c8ba206
commit 679e81ac7d
13 changed files with 96 additions and 97 deletions

View file

@ -41,6 +41,6 @@ def can_view(user):
can = user.has_module_perms("users")
return (
can,
None if can else _("You don't have the right to view this" " application."),
None if can else _("You don't have the right to view this application."),
("users",),
)

View file

@ -150,7 +150,7 @@ class UserCreationForm(FormRevMixin, forms.ModelForm):
return self.cleaned_data.get("email").lower()
else:
raise forms.ValidationError(
_("You can't use an internal address" " as your external address.")
_("You can't use an internal address as your external address.")
)
class Meta:
@ -293,7 +293,7 @@ class MassArchiveForm(forms.Form):
date = forms.DateTimeField(help_text="%d/%m/%y")
full_archive = forms.BooleanField(
label=_(
"Make a full archive operation ? (WARNING : CRITICAL OPERATION IF TRUE)"
"Fully archive users? WARNING: CRITICAL OPERATION IF TRUE"
),
initial=False,
required=False,
@ -384,15 +384,14 @@ class AdherentCreationForm(AdherentForm):
# Champ permettant d'éviter au maxium les doublons d'utilisateurs
former_user_check_info = _(
"If you already have an account, please use it. "
+ "If your lost access to it, please consider "
+ "using the forgotten password button on the "
+ "login page or contacting support."
"If you already have an account, please use it. If your lost access to"
" it, please consider using the forgotten password button on the"
" login page or contacting support."
)
former_user_check = forms.BooleanField(
required=True, help_text=former_user_check_info
)
former_user_check.label = _("I certify that I have not had an account before")
former_user_check.label = _("I certify that I have not had an account before.")
# Checkbox for GTU
gtu_check = forms.BooleanField(required=True)
@ -657,7 +656,7 @@ class NewListRightForm(ListRightForm):
def __init__(self, *args, **kwargs):
super(NewListRightForm, self).__init__(*args, **kwargs)
self.fields["gid"].label = _(
"GID. Warning: this field must not be" " edited after creation."
"GID. Warning: this field must not be edited after creation."
)
@ -734,7 +733,7 @@ class EMailAddressForm(FormRevMixin, ModelForm):
prefix = kwargs.pop("prefix", self.Meta.model.__name__)
super(EMailAddressForm, self).__init__(*args, prefix=prefix, **kwargs)
self.fields["local_part"].label = _("Local part of the email address")
self.fields["local_part"].help_text = _("Can't contain @")
self.fields["local_part"].help_text = _("Can't contain @.")
def clean_local_part(self):
return self.cleaned_data.get("local_part").lower()

View file

@ -102,7 +102,7 @@ def linux_user_validator(login):
pas les contraintes unix (maj, min, chiffres ou tiret)"""
if not linux_user_check(login):
raise forms.ValidationError(
_("The username '%(label)s' contains forbidden characters."),
_("The username \"%(label)s\" contains forbidden characters."),
params={"label": login},
)
@ -181,7 +181,7 @@ class User(
(1, _("Disabled")),
(2, _("Archived")),
(3, _("Not yet active")),
(4, _("Full Archived")),
(4, _("Fully archived")),
)
surname = models.CharField(max_length=255)
@ -213,7 +213,7 @@ class User(
"ListShell", on_delete=models.PROTECT, null=True, blank=True
)
comment = models.CharField(
help_text=_("Comment, school year"), max_length=255, blank=True
help_text=_("Comment, school year."), max_length=255, blank=True
)
pwd_ntlm = models.CharField(max_length=255)
state = models.IntegerField(choices=STATES, default=STATE_NOT_YET_ACTIVE)
@ -222,7 +222,7 @@ class User(
uid_number = models.PositiveIntegerField(default=get_fresh_user_uid, unique=True)
rezo_rez_uid = models.PositiveIntegerField(unique=True, blank=True, null=True)
shortcuts_enabled = models.BooleanField(
verbose_name=_("Enable shortcuts on Re2o website"), default=True
verbose_name=_("enable shortcuts on Re2o website"), default=True
)
USERNAME_FIELD = "pseudo"
@ -238,9 +238,9 @@ class User(
("change_user_shell", _("Can edit the shell of a user")),
(
"change_user_groups",
_("Can edit the groups of rights of a user (critical" " permission)"),
_("Can edit the groups of rights of a user (critical permission)"),
),
("change_all_users", _("Can edit all users, including those with rights.")),
("change_all_users", _("Can edit all users, including those with rights")),
("view_user", _("Can view a user object")),
)
verbose_name = _("user (member or club)")
@ -548,21 +548,21 @@ class User(
interfaces = self.user_interfaces()
with transaction.atomic(), reversion.create_revision():
Interface.mass_assign_ipv4(interfaces)
reversion.set_comment(_("IPv4 assigning"))
reversion.set_comment("IPv4 assignment")
def unassign_ips(self):
""" Désassigne les ipv4 aux machines de l'user"""
interfaces = self.user_interfaces()
with transaction.atomic(), reversion.create_revision():
Interface.mass_unassign_ipv4(interfaces)
reversion.set_comment(_("IPv4 unassigning"))
reversion.set_comment("IPv4 unassignment")
@classmethod
def mass_unassign_ips(cls, users_list):
interfaces = cls.users_interfaces(users_list)
with transaction.atomic(), reversion.create_revision():
Interface.mass_unassign_ipv4(interfaces)
reversion.set_comment(_("IPv4 assigning"))
reversion.set_comment("IPv4 assignment")
@classmethod
def mass_disable_email(cls, queryset_users):
@ -761,11 +761,10 @@ class User(
"url": request.build_absolute_uri(
reverse("users:process", kwargs={"token": req.token})
),
"expire_in": str(GeneralOption.get_cached_value("req_expire_hrs"))
+ " hours",
"expire_in": str(GeneralOption.get_cached_value("req_expire_hrs")),
}
send_mail(
"Changement de mot de passe du %(name)s / Password renewal for "
"Changement de mot de passe de %(name)s / Password change for "
"%(name)s" % {"name": AssoOption.get_cached_value("name")},
template.render(context),
GeneralOption.get_cached_value("email_from"),
@ -902,7 +901,7 @@ class User(
if self.groups.filter(listright__critical=True):
return (
False,
_("User with critical rights, can't be edited. "),
_("User with critical rights, can't be edited."),
("users.change_all_users",),
)
elif self == AssoOption.get_cached_value("utilisateur_asso"):
@ -910,7 +909,7 @@ class User(
False,
_(
"Impossible to edit the organisation's"
" user without the 'change_all_users' right."
" user without the \"change_all_users\" right."
),
("users.change_all_users",),
)
@ -985,7 +984,7 @@ class User(
):
return (
False,
_("Permission required to change the room."),
_("You don't have the right to change the room."),
("users.change_user",),
)
else:
@ -1002,7 +1001,7 @@ class User(
can = user_request.has_perm("users.change_user_state")
return (
can,
_("Permission required to change the state.") if not can else None,
_("You don't have the right to change the state.") if not can else None,
("users.change_user_state",),
)
@ -1022,7 +1021,7 @@ class User(
):
return (
False,
_("Permission required to change the shell."),
_("You don't have the right to change the shell."),
("users.change_user_shell",),
)
else:
@ -1069,7 +1068,7 @@ class User(
can = user_request.has_perm("users.change_user_force")
return (
can,
_("Permission required to force the move.") if not can else None,
_("You don't have the right to force the move.") if not can else None,
("users.change_user_force",),
)
@ -1084,7 +1083,7 @@ class User(
can = user_request.has_perm("users.change_user_grou")
return (
can,
_("Permission required to edit the user's groups of rights.")
_("You don't have the right to edit the user's groups of rights.")
if not can
else None,
("users.change_user_groups"),
@ -1100,7 +1099,7 @@ class User(
can = user_request.is_superuser
return (
can,
_("'superuser' right required to edit the superuser flag.")
_("\"superuser\" right required to edit the superuser flag.")
if not can
else None,
[],
@ -1241,7 +1240,7 @@ class Adherent(User):
gpg_fingerprint = self.gpg_fingerprint.replace(" ", "").upper()
if not re.match("^[0-9A-F]{40}$", gpg_fingerprint):
raise ValidationError(
_("A GPG fingerprint must contain 40 hexadecimal characters")
_("A GPG fingerprint must contain 40 hexadecimal characters.")
)
self.gpg_fingerprint = gpg_fingerprint
@ -1265,7 +1264,7 @@ class Adherent(User):
if not user_request.is_authenticated and not OptionalUser.get_cached_value(
"self_adhesion"
):
return False, _("Self adhesion is disabled."), None
return False, _("Self registration is disabled."), None
else:
if OptionalUser.get_cached_value(
"all_can_create_adherent"
@ -1418,7 +1417,7 @@ class ServiceUser(RevMixin, AclMixin, AbstractBaseUser):
validators=[linux_user_validator],
)
access_group = models.CharField(choices=ACCESS, default=readonly, max_length=32)
comment = models.CharField(help_text=_("Comment"), max_length=255, blank=True)
comment = models.CharField(help_text=_("Comment."), max_length=255, blank=True)
USERNAME_FIELD = "pseudo"
objects = UserManager()
@ -1518,13 +1517,13 @@ class ListRight(RevMixin, AclMixin, Group):
validators=[
RegexValidator(
"^[a-z]+$",
message=(_("UNIX groups can only contain lower case letters.")),
message=(_("UNIX group names can only contain lower case letters.")),
)
],
)
gid = models.PositiveIntegerField(unique=True, null=True)
critical = models.BooleanField(default=False)
details = models.CharField(help_text=_("Description"), max_length=255, blank=True)
details = models.CharField(help_text=_("Description."), max_length=255, blank=True)
class Meta:
permissions = (("view_listright", _("Can view a group of rights object")),)
@ -1643,7 +1642,7 @@ class Ban(RevMixin, AclMixin, models.Model):
if not user_request.has_perm("users.view_ban") and self.user != user_request:
return (
False,
_("You don't have the right to view bans other than yours."),
_("You don't have the right to view other bans than yours."),
("users.view_ban",),
)
else:
@ -1713,7 +1712,7 @@ class Whitelist(RevMixin, AclMixin, models.Model):
):
return (
False,
_("You don't have the right to view whitelists other than yours."),
_("You don't have the right to view other whitelists than yours."),
("users.view_whitelist",),
)
else:
@ -1910,10 +1909,10 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
"""
user = models.ForeignKey(
User, on_delete=models.CASCADE, help_text=_("User of the local email account")
User, on_delete=models.CASCADE, help_text=_("User of the local email account.")
)
local_part = models.CharField(
unique=True, max_length=128, help_text=_("Local part of the email address")
unique=True, max_length=128, help_text=_("Local part of the email address.")
)
class Meta:
@ -1990,7 +1989,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
return (
False,
_(
"You don't have the right to edit another user's local"
"You don't have the right to view another user's local"
" email account."
),
("users.view_emailaddress",),
@ -2025,7 +2024,7 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
False,
_(
"You don't have the right to delete another user's"
" local email account"
" local email account."
),
("users.delete_emailaddress",),
)

View file

@ -37,7 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<i class="fa fa-address-book"></i>
{% trans "Superuser" %}
</h4>
{% trans "Django's specific pre-defined right that supersed any other rights." %}
{% trans "Django's specific pre-defined right that supersedes any other rights." %}
</div>
<div class="panel-collapse collapse" id="collapse_superuser">
<div class="panel-body">

View file

@ -30,7 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<thead>
<tr>
<th>{% trans "Name" %}</th>
<th>{% trans "Role" %}</th>
<th>{% trans "Access group" %}</th>
<th>{% trans "Comment" %}</th>
<th></th>
</tr>

View file

@ -32,9 +32,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
<h2>{% trans "List of groups of rights" %}</h2>
{% can_create ListRight %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-listright' %}"><i class="fa fa-plus"></i>{% trans " Add a group of rights" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-listright' %}"><i class="fa fa-plus"></i> {% trans "Add a group of rights" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-listright' %}"><i class="fa fa-trash"></i>{% trans " Delete one or several groups of rights" %}</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-listright' %}"><i class="fa fa-trash"></i> {% trans "Delete one or several groups of rights" %}</a>
<br />
<br />
{% include 'users/aff_listright.html' %}

View file

@ -31,11 +31,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
<h2>{% trans "List of schools" %}</h2>
<h5>{% trans "List of schools for created users" %}</h5>
<h5>{% trans "List of schools for registered users" %}</h5>
{% can_create School %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="fa fa-plus"></i>{% trans " Add a school" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-school' %}"><i class="fa fa-plus"></i> {% trans "Add a school" %}</a>
{% acl_end %}
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="fa fa-trash"></i>{% trans " Delete one or several schools" %}</a>
<a class="btn btn-danger btn-sm" role="button" href="{% url 'users:del-school' %}"><i class="fa fa-trash"></i> {% trans "Delete one or several schools" %}</a>
<hr>
{% include 'users/aff_schools.html' with school_list=school_list %}
<br />

View file

@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<h2>{% trans "List of LDAP service users" %}</h2>
<h5>{% trans "The LDAP service users are special users having access only to the LDAP for authentication operations. It is recommended to create a service user with a login and a password for any concerned service." %}</h5>
{% can_create ServiceUser %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:new-serviceuser' %}"><i class="fa fa-plus"></i>{% trans " Add a service user" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:new-serviceuser' %}"><i class="fa fa-plus"></i> {% trans "Add a service user" %}</a>
{% acl_end %}
{% include 'users/aff_serviceusers.html' with serviceusers_list=serviceusers_list %}
<br />

View file

@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
<h2>{% trans "List of shells" %}</h2>
{% can_create ListShell %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-shell' %}"><i class="fa fa-plus"></i>{% trans " Add a shell" %}</a>
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-shell' %}"><i class="fa fa-plus"></i> {% trans "Add a shell" %}</a>
{% acl_end %}
{% include 'users/aff_shell.html' with shell_list=shell_list %}
<br />

View file

@ -36,7 +36,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<input type="submit" name="valider" value={% trans "Confirm" %} class="btn btn-primary" id="submit-id-submit">
</form>
<h3>{% blocktrans %}The following users will be archived ({{ to_archive_list|length }}):{% endblocktrans %}</h3>
<h3>{% blocktrans %}The following users will be archived:{% endblocktrans %}</h3>
{% include 'users/aff_users.html' with users_list=to_archive_list %}
<br />
<br />

View file

@ -43,7 +43,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="col-sm-6 {% if solde_activated %}col-md-4{% else %}col_md-6{% endif %}">
{% if users.is_ban%}
<div class="panel panel-danger">
<div class="panel-heading dashboard">{% trans "Your account has been banned" %}</div>
<div class="panel-heading dashboard">{% trans "Your account has been banned." %}</div>
<div class="panel-body dashboard">
<i class="text-danger">{% blocktrans with end_ban_date=users.end_ban|date:"SHORT_DATE_FORMAT" %}End of the ban: {{ end_ban_date }}{% endblocktrans %}</i>
</div>
@ -57,7 +57,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<i class="fa fa-sign-in"></i> {% trans "Pay for a connection" %}
</a>
{% acl_else %}
{% trans "Ask for someone with the appropriate rights to pay for a connection." %}
{% trans "Ask someone with the appropriate rights to pay for a connection." %}
{% acl_end %}
</div>
</div>
@ -94,11 +94,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-info">
<div class="panel-heading dashboard" data-parent="#accordion" data-toggle="collapse"
data-target="#machines">
<i class="fa fa-desktop"></i>{% trans " Machines" %} <span class="badge"> {{ nb_machines }}</span>
<i class="fa fa-desktop"></i> {% trans "Machines" %} <span class="badge"> {{ nb_machines }}</span>
</div>
<div class="panel-body dashboard">
<a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
<i class="fa fa-desktop"></i>{% trans " Add a machine" %}
<i class="fa fa-desktop"></i> {% trans "Add a machine" %}
</a>
</div>
</div>
@ -110,7 +110,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
<div class="panel-body dashboard">
<a class="btn btn-warning btn-sm" role="button" href="{% url 'machines:new-machine' users.id %}">
<i class="fa fa-desktop"></i>{% trans " Add a machine" %}
<i class="fa fa-desktop"></i> {% trans "Add a machine" %}
</a>
</div>
</div>
@ -125,7 +125,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse"
data-target="#information">
<h3 class="panel-title pull-left">
<i class="fa fa-user"></i>{% trans " Detailed information" %}
<i class="fa fa-user"></i> {% trans "Detailed information" %}
</h3>
</div>
<div class="panel-collapse collapse collapse-default" id="information">
@ -225,7 +225,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% if users.end_adhesion != None %}
<dd><i class="text-success">{{ users.end_adhesion }}</i></dd>
{% else %}
<dd><i class="text-danger">{% trans "not a member" %}</i></dd>
<dd><i class="text-danger">{% trans "Not a member" %}</i></dd>
{% endif %}
</div>
@ -256,9 +256,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% elif users.state == 2 %}
<dd><i class="text-danger">{% trans "Archived" %}</i></dd>
{% elif users.state == 3 %}
<dd><i class="text-danger">{% trans "Not yet member" %}</i></dd>
<dd><i class="text-danger">{% trans "Not yet active" %}</i></dd>
{% elif users.state == 4 %}
<dd><i class="text-danger">{% trans "Full Archived" %}</i></dd>
<dd><i class="text-danger">{% trans "Fully archived" %}</i></dd>
{% endif %}
</div>
@ -320,7 +320,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#club">
<h3 class="panel-title pull-left">
<i class="fa fa-users"></i>{% trans " Manage the club" %}
<i class="fa fa-users"></i> {% trans "Manage the club" %}
</h3>
</div>
<div class="panel-collapse collapse" id="club">
@ -484,14 +484,14 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<div class="panel panel-default">
<div class="panel-heading clearfix profil" data-parent="#accordion" data-toggle="collapse" data-target="#email">
<h3 class="panel-title pull-left">
<i class="fa fa-envelope"></i>{% trans " Email settings" %}
<i class="fa fa-envelope"></i> {% trans "Email settings" %}
</h3>
</div>
<div id="email" class="panel-collapse collapse">
<div class="panel-body">
{% can_edit users %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:edit-email-settings' users.id %}">
<i class="fa fa-pencil"></i>{% trans " Edit email settings" %}
<i class="fa fa-pencil"></i> {% trans "Edit email settings" %}
</a>
{% acl_end %}
</div>
@ -510,12 +510,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<td>{{ users.local_email_redirect | tick }}</td>
</tr>
</table>
<p>{% trans "The contact email address is the email address where we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}</p>
<p>{% trans "The contact email address is the email address to which we send emails to contact you. If you would like to use your external email address for that, you can either disable your local email address or enable the local email redirection." %}</p>
</div>
{% if users.local_email_enabled %}
{% can_create EMailAddress users.id %}
<a class="btn btn-primary btn-sm" role="button" href="{% url 'users:add-emailaddress' users.id %}">
<i class="fa fa-plus-square"></i>{% trans " Add an email address" %}
<i class="fa fa-plus-square"></i> {% trans "Add an email address" %}
</a>
{% acl_end %}
{% if emailaddress_list %}

View file

@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% block content %}
{% bootstrap_form_errors userform %}
<h2>{% blocktrans %}Device and room register form{% endblocktrans %}</h2>
<h2>{% trans "Device and room register form" %}</h2>
<form class="form" method="post">
{% csrf_token %}
@ -61,7 +61,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
</div>
<center>{% bootstrap_button _("OK") button_type="submit" icon='ok' button_class='btn-success' %}</center>
{% trans "OK" as tr_ok %}
<center>{% bootstrap_button tr_ok button_type="submit" icon='ok' button_class='btn-success' %}</center>
</form>

View file

@ -124,7 +124,7 @@ def new_user(request):
user.reset_passwd_mail(request)
messages.success(
request,
_("The user %s was created, an email to set" " the password was sent.")
_("The user %s was created, an email to set the password was sent.")
% user.pseudo,
)
return redirect(reverse("users:profil", kwargs={"userid": str(user.id)}))
@ -153,7 +153,7 @@ def new_club(request):
club.reset_passwd_mail(request)
messages.success(
request,
_("The club %s was created, an email to set" " the password was sent.")
_("The club %s was created, an email to set the password was sent.")
% club.pseudo,
)
return redirect(reverse("users:profil", kwargs={"userid": str(club.id)}))
@ -181,7 +181,7 @@ def edit_club_admin_members(request, club_instance, **_kwargs):
{
"userform": club,
"showCGU": False,
"action_name": _("Edit the admins and members"),
"action_name": _("Edit"),
},
"users/user.html",
request,
@ -208,7 +208,7 @@ def edit_info(request, user, userid):
messages.success(request, _("The user was edited."))
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
return form(
{"userform": user_form, "action_name": _("Edit the user")},
{"userform": user_form, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -225,7 +225,7 @@ def state(request, user, userid):
messages.success(request, _("The state was edited."))
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
return form(
{"userform": state_form, "action_name": _("Edit the state")},
{"userform": state_form, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -242,7 +242,7 @@ def groups(request, user, userid):
messages.success(request, _("The groups were edited."))
return redirect(reverse("users:profil", kwargs={"userid": str(userid)}))
return form(
{"userform": group_form, "action_name": _("Edit the groups")},
{"userform": group_form, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -297,7 +297,7 @@ def new_serviceuser(request):
messages.success(request, _("The service user was created."))
return redirect(reverse("users:index-serviceusers"))
return form(
{"userform": user, "action_name": _("Create a service user")},
{"userform": user, "action_name": _("Add")},
"users/user.html",
request,
)
@ -314,7 +314,7 @@ def edit_serviceuser(request, serviceuser, **_kwargs):
messages.success(request, _("The service user was edited."))
return redirect(reverse("users:index-serviceusers"))
return form(
{"userform": serviceuser, "action_name": _("Edit a service user")},
{"userform": serviceuser, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -329,7 +329,7 @@ def del_serviceuser(request, serviceuser, **_kwargs):
messages.success(request, _("The service user was deleted."))
return redirect(reverse("users:index-serviceusers"))
return form(
{"objet": serviceuser, "objet_name": "service user"},
{"objet": serviceuser, "objet_name": _("service user")},
"users/delete.html",
request,
)
@ -351,7 +351,7 @@ def add_ban(request, user, userid):
if user.is_ban():
messages.error(request, _("Warning: this user already has an active ban."))
return form(
{"userform": ban, "action_name": _("Add a ban")}, "users/user.html", request
{"userform": ban, "action_name": _("Add")}, "users/user.html", request
)
@ -368,7 +368,7 @@ def edit_ban(request, ban_instance, **_kwargs):
messages.success(request, _("The ban was edited."))
return redirect(reverse("users:index"))
return form(
{"userform": ban, "action_name": _("Edit a ban")}, "users/user.html", request
{"userform": ban, "action_name": _("Edit")}, "users/user.html", request
)
@ -380,7 +380,7 @@ def del_ban(request, ban, **_kwargs):
ban.delete()
messages.success(request, _("The ban was deleted."))
return redirect(reverse("users:profil", kwargs={"userid": str(ban.user.id)}))
return form({"objet": ban, "objet_name": "ban"}, "users/delete.html", request)
return form({"objet": ban, "objet_name": _("ban")}, "users/delete.html", request)
@login_required
@ -402,7 +402,7 @@ def add_whitelist(request, user, userid):
request, _("Warning: this user already has an active whitelist.")
)
return form(
{"userform": whitelist, "action_name": _("Add a whitelist")},
{"userform": whitelist, "action_name": _("Add")},
"users/user.html",
request,
)
@ -422,7 +422,7 @@ def edit_whitelist(request, whitelist_instance, **_kwargs):
messages.success(request, _("The whitelist was edited."))
return redirect(reverse("users:index"))
return form(
{"userform": whitelist, "action_name": _("Edit a whitelist")},
{"userform": whitelist, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -439,7 +439,7 @@ def del_whitelist(request, whitelist, **_kwargs):
reverse("users:profil", kwargs={"userid": str(whitelist.user.id)})
)
return form(
{"objet": whitelist, "objet_name": "whitelist"}, "users/delete.html", request
{"objet": whitelist, "objet_name": _("whitelist")}, "users/delete.html", request
)
@ -460,7 +460,7 @@ def add_emailaddress(request, user, userid):
{
"userform": emailaddress,
"showCGU": False,
"action_name": _("Add a local email account"),
"action_name": _("Add"),
},
"users/user.html",
request,
@ -487,7 +487,7 @@ def edit_emailaddress(request, emailaddress_instance, **_kwargs):
{
"userform": emailaddress,
"showCGU": False,
"action_name": _("Edit a local email account"),
"action_name": _("Edit"),
},
"users/user.html",
request,
@ -505,7 +505,7 @@ def del_emailaddress(request, emailaddress, **_kwargs):
reverse("users:profil", kwargs={"userid": str(emailaddress.user.id)})
)
return form(
{"objet": emailaddress, "objet_name": "emailaddress"},
{"objet": emailaddress, "objet_name": _("email address")},
"users/delete.html",
request,
)
@ -530,7 +530,7 @@ def edit_email_settings(request, user_instance, **_kwargs):
"userform": email_settings,
"showCGU": False,
"load_js_file": "/static/js/email_address.js",
"action_name": _("Edit the email settings"),
"action_name": _("Edit"),
},
"users/user.html",
request,
@ -548,7 +548,7 @@ def add_school(request):
messages.success(request, _("The school was added."))
return redirect(reverse("users:index-school"))
return form(
{"userform": school, "action_name": _("Add a school")},
{"userform": school, "action_name": _("Add")},
"users/user.html",
request,
)
@ -566,7 +566,7 @@ def edit_school(request, school_instance, **_kwargs):
messages.success(request, _("The school was edited."))
return redirect(reverse("users:index-school"))
return form(
{"userform": school, "action_name": _("Edit a school")},
{"userform": school, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -597,7 +597,7 @@ def del_school(request, instances):
)
return redirect(reverse("users:index-school"))
return form(
{"userform": school, "action_name": _("Delete")}, "users/user.html", request
{"userform": school, "action_name": _("Confirm")}, "users/user.html", request
)
@ -611,7 +611,7 @@ def add_shell(request):
messages.success(request, _("The shell was added."))
return redirect(reverse("users:index-shell"))
return form(
{"userform": shell, "action_name": _("Add a shell")}, "users/user.html", request
{"userform": shell, "action_name": _("Add")}, "users/user.html", request
)
@ -626,7 +626,7 @@ def edit_shell(request, shell_instance, **_kwargs):
messages.success(request, _("The shell was edited."))
return redirect(reverse("users:index-shell"))
return form(
{"userform": shell, "action_name": _("Edit a shell")},
{"userform": shell, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -640,7 +640,7 @@ def del_shell(request, shell, **_kwargs):
shell.delete()
messages.success(request, _("The shell was deleted."))
return redirect(reverse("users:index-shell"))
return form({"objet": shell, "objet_name": "shell"}, "users/delete.html", request)
return form({"objet": shell, "objet_name": _("shell")}, "users/delete.html", request)
@login_required
@ -654,7 +654,7 @@ def add_listright(request):
messages.success(request, _("The group of rights was added."))
return redirect(reverse("users:index-listright"))
return form(
{"userform": listright, "action_name": _("Add a group of rights")},
{"userform": listright, "action_name": _("Add")},
"users/user.html",
request,
)
@ -672,7 +672,7 @@ def edit_listright(request, listright_instance, **_kwargs):
messages.success(request, _("The group of rights was edited."))
return redirect(reverse("users:index-listright"))
return form(
{"userform": listright, "action_name": _("Edit a group of rights")},
{"userform": listright, "action_name": _("Edit")},
"users/user.html",
request,
)
@ -689,7 +689,7 @@ def del_listright(request, instances):
for listright_del in listright_dels:
try:
listright_del.delete()
messages.success(request, _("The group of rights was" " deleted."))
messages.success(request, _("The group of rights was deleted."))
except ProtectedError:
messages.error(
request,
@ -701,7 +701,7 @@ def del_listright(request, instances):
)
return redirect(reverse("users:index-listright"))
return form(
{"userform": listright, "action_name": _("Delete")}, "users/user.html", request
{"userform": listright, "action_name": _("Confirm")}, "users/user.html", request
)
@ -993,7 +993,7 @@ def process_passwd(request, req):
if u_form.is_valid():
with transaction.atomic(), reversion.create_revision():
u_form.save()
reversion.set_comment(_("Password reset"))
reversion.set_comment("Password reset")
req.delete()
messages.success(request, _("The password was changed."))
return redirect(reverse("index"))