Use get_or_create to fix database inconsistencies

This commit is contained in:
Trever Fischer
2012-06-08 15:27:30 -04:00
parent b04076b357
commit da2355681c
3 changed files with 4 additions and 4 deletions

View File

@@ -51,7 +51,7 @@ class Invite(models.Model):
def create_account(sender, instance, created, **kwargs):
if created:
CurrencyAccount.objects.create(profile=instance)
CurrencyAccount.objects.get_or_create(profile=instance)
post_save.connect(create_account, sender=MinecraftProfile)