david / django-invitation

Built on top of django-registration, it restricts registration to a given number of invited person per active user (strategy introduced by GMail to involve 2.0 users).

Clone this repository (size: 60.6 KB): HTTPS / SSH
$ hg clone http://code.welldev.org/django-invitation

Changed (Δ39 bytes):

raw changeset »

invitation/models.py (1 lines added, 1 lines removed)

Up to file-list invitation/models.py:

@@ -38,7 +38,7 @@ class InvitationKeyManager(models.Manage
38
38
        from a combination of the ``User``'s username and a random salt.
39
39
        """
40
40
        salt = sha_constructor(str(random.random())).hexdigest()[:5]
41
        key = sha_constructor(salt+user.username).hexdigest()
41
        key = sha_constructor("%s%s%s" % (datetime.datetime.now(), salt, user.username)).hexdigest()
42
42
        return self.create(from_user=user, key=key)
43
43
44
44
    def remaining_invitations_for_user(self, user):