dlamotte / django-tagging

Automatically exported from code.google.com/p/django-tagging
Other
0 stars 0 forks source link

1062 integrity error when saving a model #276

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm getting this error (snippet: http://dpaste.org/JfeWw/ )
per debugging, on line 7 both force_insert and force_update == False
but as you can see on line 19, the tag is becoming force_insert=True, which 
ends up running this command:
INSERT INTO `tagging_taggeditem` (`tag_id`, `content_type_id`, `object_id`) 
VALUES (13, 16, 511)

but those values already exist (because I'm just updating the object)

Original issue reported on code.google.com by lestr...@gmail.com on 5 Jun 2012 at 7:55

GoogleCodeExporter commented 8 years ago
well
after a little more debugging I found out that's probably not the cause
the tags for this article are "brasil,Brasil,", which translate to the same tag 
when doing the query, so it actually tries to add "brasil" twice

any ideas for the best solution to ignore duplicate tags?

Original comment by lestr...@gmail.com on 5 Jun 2012 at 7:58