Skip to content

Field Unique fails when trying to bulk updateΒ #79

@jrujano-zz

Description

@jrujano-zz

Model

class Email(models.Model):

email = models.EmailField("Email", unique=True)

Trying to upgrade to a model with a field with the value of unique = true; generates the following error:

/lib/python3.6/site-packages/rest_framework/validators.py", line 71, in exclude_current_instance
    return queryset.exclude(pk=self.instance.pk)

Exception Type: AttributeError at /contracts/api/requestboxup/
Exception Value: 'QuerySet' object has no attribute 'pk'

Note: removing the unique = true property; it works perfectly

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions