david / django-invitation-backend (http://code.welldev.org/django-invitation/)
fork of django-invitation
A fork of django-invitation to use the new django-registration-backends branch. See http://bitbucket.org/ubernostrum/django-registr... for the reasons.
Clone this repository (size: 52.3 KB): HTTPS / SSH
$ hg clone http://code.welldev.org/django-invitation-backend
| commit 15: | 343ccff7a4df |
| parent 14: | 2c779a2dd41a |
| branch: | default |
Fixes #7: Good catch from ebaum, salt was too small to prevent collisions
15 months ago
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( |
|
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): |
