Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field Unique fails when trying to bulk update #79

Open
jrujano-zz opened this issue Apr 24, 2020 · 0 comments
Open

Field Unique fails when trying to bulk update #79

jrujano-zz opened this issue Apr 24, 2020 · 0 comments

Comments

@jrujano-zz
Copy link

jrujano-zz commented Apr 24, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant