foreign key constraint "environment_classes_puppetclass_id_fk"

Hi guys,

with foreman 1.4.1 I've got this error message when I try to delete a class
:

Warning!ERROR: update or delete on table "puppetclasses" violates foreign
key constraint "environment_classes_puppetclass_id_fk" on table
"environment_classes" DETAIL: Key (id)=(7) is still referenced from table
"environment_classes".

If you feel this is an error with Foreman itself, please open a new issue
with Foreman ticketing system<Issues - Foreman>,
You would probably need to attach the Full trace<https://styx.lix.polytechnique.fr/puppetclasses/network::manage::alias#>and relevant log entries.
PGError
*ERROR: update or delete on table "puppetclasses" violates foreign key
constraint "environment_classes_puppetclass_id_fk" on table
"environment_classes" DETAIL: Key (id)=(7) is still referenced from table
"environment_classes". *
app/controllers/puppetclasses_controller.rb:42:in destroy&#39; app/models/concerns/foreman/thread_session.rb:33:inclear_thread'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

A ticket has been opened (Bug #4379: Foreign key constraint error on deleting a class - Foreman) some
days ago, but there is no answer yet.

Can somebody help me to find a way for solving this issue.

James