Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

Commit

Permalink
fix typo in code max_length
Browse files Browse the repository at this point in the history
  • Loading branch information
relekang committed Feb 24, 2013
1 parent ee35a86 commit 13cbe7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion django_nopassword/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import string
from random import choice
from datetime import datetime

from django.conf import settings
from django.core.mail import send_mail
from django.core.urlresolvers import reverse
Expand All @@ -12,7 +13,7 @@

class LoginCode(models.Model):
user = models.ForeignKey(User, related_name='login_codes', editable=False, verbose_name=_('user'))
code = models.CharField(max_length=2, editable=False, verbose_name=_('code'))
code = models.CharField(max_length=20, editable=False, verbose_name=_('code'))
timestamp = models.DateTimeField(editable=False)
next = models.TextField(editable=False, blank=True)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name = "django-nopassword",
version = '0.1.1',
version = '0.1.2',
url='http://github.com/relekang/django-nopassword',
author = 'Rolf Erik Lekang',
author_email = 'me@rolflekang.com',
Expand Down
3 changes: 2 additions & 1 deletion tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.utils import unittest

from django_nopassword.models import LoginCode


Expand All @@ -11,7 +12,7 @@ def setUp(self):

def test_login_backend(self):
self.code = LoginCode.create_code_for_user(self.user)
self.assertIsNotNone(self.code.pk)
self.assertEqual(len(self.code.code), 20)
self.assertIsNotNone(authenticate(username=self.user.username, code=self.code.code))
self.assertEqual(LoginCode.objects.filter(user=self.user, code=self.code.code).count(), 0)

Expand Down

0 comments on commit 13cbe7b

Please sign in to comment.