Skip to content

Updating an object with a unique field raises a validation exception. #37

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

Open
aanastasiou opened this issue Jan 27, 2014 · 0 comments
Open

Comments

@aanastasiou
Copy link

With Redisco 0.1.4

class Foo(models.Model):
Field1 = models.Attribute(indexed = True)
Field2 = models.Attribute(unique = True)

Foo(Field1="1", Field2 = "blah").save(); Foo(Field1="Alpha", Field2 = "Beta").save()

Q = Foo.objects.all()[0]
Q.update_attributes(Field1 = "Whatever")
Q.save()

This returns a failed validation message that Field2 is not unique.

If i am not missing something here, this is a simple update, not even touching the field that is declared as unique and after that operation the "unique" condition would still hold.

BTW, in the above example, if the field is not declared as unique then everything works as expected...but then i really want the field to be declared as unique :)

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