We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9ab17a commit 7121cabCopy full SHA for 7121cab
invitation/models.py
@@ -1,14 +1,17 @@
1
from django.db import models
2
from django.utils.translation import ugettext_lazy as _
3
from django.contrib.auth.models import User
4
+import random
5
+import string
6
7
8
class InvitationCode(models.Model):
9
"""Invitation code model"""
- code = models.CharField(blank=True, max_length=5, unique=True,
10
+ code = models.CharField(blank=True, max_length=256, unique=True,
11
verbose_name=_(u"Invitation code"))
12
is_used = models.BooleanField(default=False,
13
verbose_name=_(u"Is code used?"))
14
user = models.ForeignKey(User, blank=True, null=True)
15
used_date = models.DateTimeField(blank=True, null=True, auto_now_add=True,
16
verbose_name=_(u"Used on"))
17
+
0 commit comments