﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
9231	get_or_create creates even if the object is already there	canburak	nobody	"my model is

{{{
class InvitationStatistic(models.Model):
    email_address = models.EmailField(max_length=125,
                                      db_index=True,
                                      unique=True)

    number_of_retries = models.IntegerField(default=0)
}}}
the code triggered the error is?
{{{
obj, created = InvitationStatistic.objects.get_or_create(email_address=self.invitee)
}}}
error is:
{{{
2008-09-28 08:17:56 EEST ERROR:  duplicate key value violates unique constraint ""user_invitationstatistic_email_address_key""
2008-09-28 08:17:56 EEST STATEMENT:  INSERT INTO ""user_invitationstatistic"" (""email_address"", ""number_of_retries"") VALUES (E'user@example.com', 0)
}}}
"		closed	Database layer (models, ORM)	0.96		invalid		vst@… tolga.tatari@…	Accepted	0	0	0	0	0	0
