From: Charles Connell Date: Tue, 28 Jan 2014 00:26:36 +0000 (-0500) Subject: Bryan's comments #264 X-Git-Tag: release-20150131~192 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ad427928f22d2032071702c7816f06cf674e7cc6;p=oweals%2Fkarmaworld.git Bryan's comments #264 --- diff --git a/karmaworld/apps/users/models.py b/karmaworld/apps/users/models.py index d6a9657..15af634 100644 --- a/karmaworld/apps/users/models.py +++ b/karmaworld/apps/users/models.py @@ -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()