Commit f7bed02a authored by chris's avatar chris

meetingpoll/models: pass a callable to default. Fixes users won't start new...

meetingpoll/models: pass a callable to default. Fixes users won't start new sessions. Solution given by Markus Tesmer.
parent bc95d2b0
......@@ -10,7 +10,7 @@ import string
import random
import jsonfield
def createId(length):
def createId(length=5):
firstchar = string.ascii_letters
c = string.digits + string.ascii_letters
lastchars = ''.join([random.choice(c) for dummy in xrange(0, length - 1)])
......@@ -39,7 +39,7 @@ class Poll(models.Model):
id = models.CharField(
primary_key=True,
max_length=8,
default=createId(5))
default=createId)
title = models.CharField(_('Title'), max_length=80)
pub_date = models.DateField(default=datetime.datetime.now)
upd_date = models.DateField(auto_now=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment