Meilleur message d'erreur
This commit is contained in:
parent
93792f5f46
commit
e8830540ec
1 changed files with 7 additions and 1 deletions
|
@ -174,7 +174,13 @@ class AddGroupView(WikiGroupMixin, BaseFormView):
|
||||||
group = self.object
|
group = self.object
|
||||||
|
|
||||||
if group.group_in_cycle(list(group.includes_groups.all()) + [subgroup]):
|
if group.group_in_cycle(list(group.includes_groups.all()) + [subgroup]):
|
||||||
form.add_error("group", "Ajout impossible sous peine de créer un cycle")
|
form.add_error(
|
||||||
|
"group",
|
||||||
|
(
|
||||||
|
"Ajout impossible sous peine de créer un cycle "
|
||||||
|
f"({group} est inclus dans {subgroup})"
|
||||||
|
),
|
||||||
|
)
|
||||||
return self.form_invalid(form)
|
return self.form_invalid(form)
|
||||||
|
|
||||||
group.includes_groups.add(subgroup)
|
group.includes_groups.add(subgroup)
|
||||||
|
|
Loading…
Reference in a new issue