Meilleur message d'erreur

This commit is contained in:
Tom Hubrecht 2021-10-26 19:20:29 +02:00
parent 93792f5f46
commit e8830540ec

View file

@ -174,7 +174,13 @@ class AddGroupView(WikiGroupMixin, BaseFormView):
group = self.object
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)
group.includes_groups.add(subgroup)