django-import-export
django-import-export copied to clipboard
How to add error message when `UNIQUE constraint failed`
when import twice get a long Traceback (most recent call last):
class Employee(models.Model):
id_number = models.CharField(max_length=180, null=True, blank=True, unique=True)
I want to show the error like admin default error message, like already exist Employee with this _id_number
I suggest search back over previous issues and Stack Overflow (if not already). If you're still stuck, please come back with more details about your setup and what you're trying to achieve. The more information you give us, the more likely it is we'll be able to help.
When add same id_number trigger UNIQUE constraint .
Django admin give a friendly error message when id number is not unique.
django-import-export give a Exception Traceback .
I want django-import-export give a friendly error message, how to do this?
Django admin error message

django-import-export error message

This may help: https://github.com/django-import-export/django-import-export/issues/1257#issuecomment-952276485
Closing due to inactivity