- 
                Notifications
    You must be signed in to change notification settings 
- Fork 193
Closed
Description
The pre_save signal fails when a model uses a UUID field as a primary key.
It seems that by the time the pre_save runs the UUID field already has a value meaning the easy audit thinks it is an update and tries to retrieve the original model from the database, which fails.
class Customer(ExportModelOperationsMixin('customer'), models.Model):
    """Model that represents a customer"""
    id = models.UUIDField(verbose_name='ID', primary_key=True, default=uuid.uuid4, editable=False, unique=True,
                          help_text='A UUID string identifying this customer')
    """The unique UUID of this :class:`Customer`"""
I think this is due to the fact that the UUID field has a default but this is required for UUID fields
Metadata
Metadata
Assignees
Labels
No labels