j'ai cette erreur dans ma base de donnees j'ai essayer par tout les moments des que j'essaye de modifier ou t'ajouter il me dit ceci

IntegrityError at /admin/automatisation/canalussd/9/change/

FOREIGN KEY constraint failed

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/automatisation/canalussd/9/change/?_changelist_filters=o%3D2.1
Django Version: 4.2.19
Exception Type: IntegrityError
Exception Value: FOREIGN KEY constraint failed
Exception Location: C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py, line 313, in _commit
Raised during: django.contrib.admin.options.change_view
Python Executable: C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Scripts\python.exe
Python Version: 3.12.9
Python Path: [‘C:\Users\stg_sall86922\Desktop\ProjetDjango’, ‘C:\Users\stg_sall86922\Desktop\ProjetDjango’, 'C:\Program ’ ‘Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\python312.zip’, 'C:\Program ’ ‘Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\DLLs’, 'C:\Program ’ ‘Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0\Lib’, 'C:\Program ’ ‘Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2544.0_x64__qbz5n2kfra8p0’, ‘C:\Users\stg_sall86922\Desktop\ProjetDjango\env’, ‘C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages’]
Server time: Sun, 02 Mar 2025 22:08:01 +0000
j’ai cette erreur dans ma base de donnees j’ai essayer par tout les moments des que j’essaye de modifier ou t’ajouter il me dit ceci

Welcome @salldina !

— From translate.google.com
Nous devrons voir le(s) modèle(s) impliqué(s) et la classe ModelAdmin

— The original English —
We will need to see the model(s) involved and the ModelAdmin class

voici le modele :

from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractUser, PermissionsMixin
from django.contrib.auth.hashers import make_password
from django.conf import settings
from django.utils import timezone
import logging
from django.db import IntegrityError

logger = logging.getLogger(__name__)

class UserManager(BaseUserManager):
    def create_user(self, email, password=None, **extra_fields):
        if not email:
            raise ValueError('The Email field must be set')
        email = self.normalize_email(email)
        user = self.model(email=email, **extra_fields)
        user.set_password(password)
        user.save(using=self._db)
        return user

    def create_superuser(self, email, password=None, **extra_fields):
        extra_fields.setdefault('is_staff', True)
        extra_fields.setdefault('is_superuser', True)

        if extra_fields.get('is_staff') is not True:
            raise ValueError('Superuser must have is_staff=True.')
        if extra_fields.get('is_superuser') is not True:
            raise ValueError('Superuser must have is_superuser=True.')

        return self.create_user(email, password, **extra_fields)

class User(AbstractUser, PermissionsMixin):
    adresse = models.CharField(max_length=100, null=True, blank=True)
    matricule = models.CharField(max_length=20, null=True, blank=True)
    direction = models.CharField(max_length=50, null=True, blank=True)
    email = models.EmailField(unique=True)
    
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = []
    
    objects = UserManager()
    
    def __str__(self):
        return self.email

class Profile(models.Model):
    user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    adresse = models.CharField(max_length=255, blank=True, null=True)
    matricule = models.CharField(max_length=50, blank=True, null=True)
    direction = models.CharField(max_length=100, blank=True, null=True)

    def __str__(self):
        return self.user.email

class CanalUSSD(models.Model):
    code = models.CharField(max_length=10, unique=True, null=False, blank=False)  
    description = models.TextField(blank=True)  

    def __str__(self):
        return self.code
    
    class Meta:
        verbose_name = "Canal USSD"
        verbose_name_plural = "Canaux USSD"

class UseCase(models.Model):
    canal = models.ForeignKey(CanalUSSD, on_delete=models.PROTECT, null=True, blank=True, related_name='usecases')
    nom = models.CharField(max_length=255)
    parent = models.ForeignKey(
        'self', 
        on_delete=models.CASCADE, 
        null=True, 
        blank=True, 
        related_name='children'
    ) 
    numerousecase = models.IntegerField(default=0)
    entree = models.CharField(max_length=255)
    sortie_attendue = models.TextField()

    def __str__(self):
        return self.nom
    
    class Meta:
        ordering = ['numerousecase']
        verbose_name = "Use Case"
        verbose_name_plural = "Use Cases"

class TestResult(models.Model):
    use_case = models.ForeignKey(
        UseCase, 
        on_delete=models.CASCADE, 
        related_name='test_results',
        null=True, 
        blank=True
    )
    date_test = models.DateTimeField(default=timezone.now)
    statut = models.CharField(
        max_length=10, 
        choices=[('OK', 'OK'), ('NOK', 'NOK')], 
        null=True,
        default='OK'
    )
    message_erreur = models.TextField(blank=True, null=True)
    
    def __str__(self):
        use_case_name = self.use_case.nom if self.use_case else "Inconnu"
        status = self.statut if self.statut else "Inconnu"
        return f"{use_case_name} - {self.date_test.strftime('%Y-%m-%d %H:%M')} - {status}"
    
    class Meta:
        ordering = ['-date_test']
        verbose_name = "Résultat de test"
        verbose_name_plural = "Résultats de tests"

class AlertConfiguration(models.Model):
    user = models.ForeignKey(
        settings.AUTH_USER_MODEL, 
        on_delete=models.CASCADE,
        related_name='alert_configurations'
    )
    email = models.EmailField()  
    canal = models.CharField(max_length=50, blank=True, null=True)  
    is_active = models.BooleanField(default=True)  

    def __str__(self):
        return f"Alerte pour {self.user.email} ({self.email})"
    
    class Meta:
        verbose_name = "Configuration d'alerte"
        verbose_name_plural = "Configurations d'alertes"

class Inscription(models.Model):
    STATUT_CHOICES = [
        ('en attente', 'En attente'),
        ('validé', 'Validé')
    ]
    
    user = models.ForeignKey(
        User, 
        on_delete=models.CASCADE, 
        related_name='inscriptions'
    )
    date_inscription = models.DateTimeField(auto_now_add=True)
    statut = models.CharField(
        max_length=20, 
        choices=STATUT_CHOICES, 
        default='en attente'
    )
    
    def __str__(self):  
        return f"{self.user.email} - {self.statut}"
    
    class Meta:
        ordering = ['-date_inscription']
        verbose_name = "Inscription"
        verbose_name_plural = "Inscriptions"

et voici le admin.py

from django.contrib import admin
from django.core.exceptions import ValidationError
from .models import TestResult, CanalUSSD, UseCase, User
# Supprimez ou commentez cette ligne car vous n'en avez pas besoin:
# from unittest import TestResult as UnitTestResult


class CanalUSSDAdmin(admin.ModelAdmin):
    list_display = ('code', 'description')
    search_fields = ('code', 'description')
    ordering = ('code',)

    def save_model(self, request, obj, form, change):
        # Empêche la modification si le CanalUSSD est référencé par des UseCase
        if change and UseCase.objects.filter(canal=obj).exists():
            raise ValidationError("Ce canal est référencé par des use cases et ne peut pas être modifié.")
        super().save_model(request, obj, form, change)

    def delete_model(self, request, obj):
        # Empêche la suppression si le CanalUSSD est référencé par des UseCase
        if UseCase.objects.filter(canal=obj).exists():
            raise ValidationError("Ce canal est référencé par des use cases et ne peut pas être supprimé.")
        super().delete_model(request, obj)


class UseCaseAdmin(admin.ModelAdmin):
    list_display = ('nom', 'canal', 'parent', 'numerousecase', 'entree', 'sortie_attendue')  
    search_fields = ('nom', 'entree', 'sortie_attendue') 
    list_filter = ('canal',)  
    ordering = ('nom',) 


class TestResultAdmin(admin.ModelAdmin):
    list_display = ('use_case', 'date_test', 'statut', 'message_erreur') 
    search_fields = ('use_case__nom', 'statut', 'message_erreur')  
    list_filter = ('statut', 'date_test')  
    ordering = ('-date_test',) 

@admin.register(User)
class UserAdmin(admin.ModelAdmin):
    list_display = ('email', 'username', 'matricule', 'direction')
    search_fields = ('email', 'prenom', 'nom', 'matricule')
    list_filter = ('direction',)

# Enregistrer les modèles avec leurs classes admin respectives
admin.site.register(CanalUSSD, CanalUSSDAdmin)  # Important: utilisez la classe admin personnalisée
admin.site.register(UseCase, UseCaseAdmin)
admin.site.register(TestResult, TestResultAdmin)

Side Note: When posting code here, enclose the code between lines of three backtick - ` characters. This means you’ll have a line of ```, then your code, then another line of ```. This forces the forum software to keep your code properly formatted.
(I have taken the liberty of modifying your post for this, please remember to do this in the future.)

— From translate.google.com

J’ai du mal à comprendre comment cette erreur pourrait être causée par l’administrateur sur ce modèle.

Avez-vous apporté des modifications récentes à vos modèles ? Si oui, avez-vous exécuté makemigrations et migrate ?
Toutes les migrations ont-elles été appliquées ? (Pouvez-vous afficher la sortie d’une commande manage.py showmigrations ?)

Cela se produit-il uniquement avec cette instance spécifique de CanalUSSD ou cela se produit-il à chaque fois ?

Pouvez-vous recréer le problème et publier le message d’erreur complet avec le traceback de la console du serveur, et non la page Web de résumé des erreurs ?

Quel moteur de base de données utilisez-vous ?

— The original English —

I’m having a difficult time seeing how this error could be caused by the Admin on this model.

Have you made any recent changes to your models? If so, have you run makemigrations and migrate?
Have all migrations been applied? (Can you show the output of a manage.py showmigrations command?)

Does this happen only with this specific instance of CanalUSSD or does it happen every time?

Can you recreate the issue and post the complete error message with the traceback from the server console, and not the error summary web page?

What database engine are you using?

voici mon modele
from django.db import models
from django.contrib.auth.models import BaseUserManager, AbstractUser, PermissionsMixin
from django.contrib.auth.hashers import make_password
from django.conf import settings
from django.utils import timezone
import logging
from django.db import IntegrityError

logger = logging.getLogger(name)

class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
if not email:
raise ValueError(‘The Email field must be set’)
email = self.normalize_email(email)
user = self.model(email=email, **extra_fields)
user.set_password(password)
user.save(using=self._db)
return user

def create_superuser(self, email, password=None, **extra_fields):
    extra_fields.setdefault('is_staff', True)
    extra_fields.setdefault('is_superuser', True)

    if extra_fields.get('is_staff') is not True:
        raise ValueError('Superuser must have is_staff=True.')
    if extra_fields.get('is_superuser') is not True:
        raise ValueError('Superuser must have is_superuser=True.')

    return self.create_user(email, password, **extra_fields)

class User(AbstractUser, PermissionsMixin):
adresse = models.CharField(max_length=100, null=True, blank=True)
matricule = models.CharField(max_length=20, null=True, blank=True)
direction = models.CharField(max_length=50, null=True, blank=True)
email = models.EmailField(unique=True)

USERNAME_FIELD = 'email'
REQUIRED_FIELDS = []

objects = UserManager()

def __str__(self):
    return self.email

class Profile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
adresse = models.CharField(max_length=255, blank=True, null=True)
matricule = models.CharField(max_length=50, blank=True, null=True)
direction = models.CharField(max_length=100, blank=True, null=True)

def __str__(self):
    return self.user.email

class CanalUSSD(models.Model):
code = models.CharField(max_length=10, unique=True, null=False, blank=False)
description = models.TextField(blank=True)

def __str__(self):
    return self.code

class Meta:
    verbose_name = "Canal USSD"
    verbose_name_plural = "Canaux USSD"

class UseCase(models.Model):
canal = models.ForeignKey(
CanalUSSD,
on_delete=models.SET_NULL, # Changé de PROTECT à SET_NULL
null=True,
blank=True,
related_name=‘usecases’
)
nom = models.CharField(max_length=255)
parent = models.ForeignKey(
‘self’,
on_delete=models.CASCADE,
null=True,
blank=True,
related_name=‘children’
)
numerousecase = models.IntegerField(default=0)
entree = models.CharField(max_length=255)
sortie_attendue = models.TextField()

def __str__(self):
    return self.nom

class Meta:
    ordering = ['numerousecase']
    verbose_name = "Use Case"
    verbose_name_plural = "Use Cases"

class TestResult(models.Model):
use_case = models.ForeignKey(
UseCase,
on_delete=models.CASCADE,
related_name=‘test_results’,
null=True,
blank=True
)
date_test = models.DateTimeField(default=timezone.now)
statut = models.CharField(
max_length=10,
choices=[(‘OK’, ‘OK’), (‘NOK’, ‘NOK’)],
null=True,
default=‘OK’
)
message_erreur = models.TextField(blank=True, null=True)

def __str__(self):
    use_case_name = self.use_case.nom if self.use_case else "Inconnu"
    status = self.statut if self.statut else "Inconnu"
    return f"{use_case_name} - {self.date_test.strftime('%Y-%m-%d %H:%M')} - {status}"

class Meta:
    ordering = ['-date_test']
    verbose_name = "Résultat de test"
    verbose_name_plural = "Résultats de tests"

class AlertConfiguration(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
related_name=‘alert_configurations’
)
email = models.EmailField()
canal = models.CharField(max_length=50, blank=True, null=True)
is_active = models.BooleanField(default=True)

def __str__(self):
    return f"Alerte pour {self.user.email} ({self.email})"

class Meta:
    verbose_name = "Configuration d'alerte"
    verbose_name_plural = "Configurations d'alertes"

class Inscription(models.Model):
STATUT_CHOICES = [
(‘en attente’, ‘En attente’),
(‘validé’, ‘Validé’)
]

user = models.ForeignKey(
    User, 
    on_delete=models.CASCADE, 
    related_name='inscriptions'
)
date_inscription = models.DateTimeField(auto_now_add=True)
statut = models.CharField(
    max_length=20, 
    choices=STATUT_CHOICES, 
    default='en attente'
)

def __str__(self):  
    return f"{self.user.email} - {self.statut}"

class Meta:
    ordering = ['-date_inscription']
    verbose_name = "Inscription"
    verbose_name_plural = "Inscriptions"

==============================================================
voici l’erreur que je recois sur toutes les tables de base supprimer ,modifier ,ajouter la meme erreur survient
(env) PS C:\Users\stg_sall86922\Desktop\ProjetDjango> python manage.py runserver
Watching for file changes with StatReloader
Performing system checks…

System check identified some issues:

WARNINGS:
?: (urls.W005) URL namespace ‘admin’ isn’t unique. You may not be able to reverse all URLs in this namespace

System check identified 1 issue (0 silenced).
March 03, 2025 - 21:13:49
Django version 4.2.19, using settings ‘automatisation_app.settings’
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

Internal Server Error: /admin/automatisation/usecase/30/change/
Traceback (most recent call last):
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 313, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: FOREIGN KEY constraint failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\core\handlers\exception.py”, line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\core\handlers\base.py”, line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\options.py”, line 688, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\decorators.py”, line 134, in _wrapper_view
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\views\decorators\cache.py”,
line 62, in _wrapper_view_func
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\sites.py”, line 242, in inner
return view(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\options.py”, line 1889, in change_view
return self.changeform_view(request, object_id, form_url, extra_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\decorators.py”, line 46, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\decorators.py”, line 134, in _wrapper_view
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\options.py”, line 1746, in changeform_view
with transaction.atomic(using=router.db_for_write(self.model)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\transaction.py”, line 263, in exit
connection.commit()
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\asyncio.py”, line 26,
in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 337, in commit
self._commit()
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 312, in _commit
with debug_transaction(self, “COMMIT”), self.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\utils.py”, line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 313, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.IntegrityError: FOREIGN KEY constraint failed
[03/Mar/2025 21:13:57] “POST /admin/automatisation/usecase/30/change/ HTTP/1.1” 500 134834
[03/Mar/2025 21:15:32] “GET /dashboard/ HTTP/1.1” 200 22468
[03/Mar/2025 21:15:32] “GET /static/images/sonatel.png HTTP/1.1” 304 0
[03/Mar/2025 21:15:43] “GET /dashboard/ HTTP/1.1” 200 22468
Internal Server Error: /admin/automatisation/usecase/30/change/
Traceback (most recent call last):
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 313, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
sqlite3.IntegrityError: FOREIGN KEY constraint failed

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\core\handlers\exception.py”, line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\core\handlers\base.py”, line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\options.py”, line 688, in wrapper
return self.admin_site.admin_view(view)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\decorators.py”, line 134, in _wrapper_view
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\views\decorators\cache.py”,
line 62, in _wrapper_view_func
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\sites.py”, line 242, in inner
return view(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\options.py”, line 1889, in change_view
return self.changeform_view(request, object_id, form_url, extra_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\decorators.py”, line 46, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\decorators.py”, line 134, in _wrapper_view
response = view_func(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\contrib\admin\options.py”, line 1746, in changeform_view
with transaction.atomic(using=router.db_for_write(self.model)):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\transaction.py”, line 263, in exit
connection.commit()
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\utils\asyncio.py”, line 26,
in inner
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 337, in commit
self._commit()
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 312, in _commit
with debug_transaction(self, “COMMIT”), self.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\utils.py”, line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File “C:\Users\stg_sall86922\Desktop\ProjetDjango\env\Lib\site-packages\django\db\backends\base\base.py”, line 313, in _commit
return self.connection.commit()
^^^^^^^^^^^^^^^^^^^^^^^^
django.db.utils.IntegrityError: FOREIGN KEY constraint failed
[03/Mar/2025 21:16:36] “POST /admin/automatisation/usecase/30/change/ HTTP/1.1” 500 134834

Si quelque ici a une solution avant la fin de la nuit suis preneuse s’il vous plait