Bryan's comments #264
authorCharles Connell <charles@connells.org>
Tue, 28 Jan 2014 00:26:36 +0000 (19:26 -0500)
committerCharles Connell <charles@connells.org>
Tue, 28 Jan 2014 00:32:04 +0000 (19:32 -0500)
karmaworld/apps/users/models.py

index d6a9657b1cc33ee4d152bc5d49b24f6af45e2057..15af634a7e465f0734e7096071971164b20a488e 100644 (file)
@@ -27,7 +27,7 @@ class UserProfile(models.Model):
     school    = models.ForeignKey(School, blank=True, null=True)
 
     def natural_key(self):
-        return (self.user)
+        return (self.user,)
 
     def get_points(self):
         sum = 0
@@ -93,7 +93,7 @@ def give_email_confirm_karma(sender, **kwargs):
 class BaseKarmaEventManager(models.Manager):
     """ Handle restoring data. """
     def get_by_natural_key(self, points, user, timestamp):
-        return self.get(points=points, user=user, timestamp=timestamp)
+        return self.get(user=user, timestamp=timestamp)
 
 
 class BaseKarmaEvent(models.Model):
@@ -106,7 +106,7 @@ class BaseKarmaEvent(models.Model):
         unique_together = ('points', 'user', 'timestamp')
 
     def natural_key(self):
-        return (self.points, self.user, self.timestamp)
+        return (self.user, self.timestamp)
 
     def get_message(self):
         raise NotImplemented()