Commit 6ebbb6392fbcbb89eedc90ec9466dd367777211f
1 parent
cc486b18
Exists in
master
and in
39 other branches
Removed lambda from model
Make migrations doesn't work with lambdas in the default value
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
src/super_archives/models.py
@@ -21,12 +21,16 @@ from .utils import blocks | @@ -21,12 +21,16 @@ from .utils import blocks | ||
21 | from .utils.etiquetador import etiquetador | 21 | from .utils.etiquetador import etiquetador |
22 | 22 | ||
23 | 23 | ||
24 | +def get_validation_key(): | ||
25 | + return uuid4().hex | ||
26 | + | ||
27 | + | ||
24 | class EmailAddressValidation(models.Model): | 28 | class EmailAddressValidation(models.Model): |
25 | address = models.EmailField(unique=True) | 29 | address = models.EmailField(unique=True) |
26 | user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, | 30 | user = models.ForeignKey(settings.AUTH_USER_MODEL, null=True, |
27 | related_name='emails_not_validated') | 31 | related_name='emails_not_validated') |
28 | validation_key = models.CharField(max_length=32, null=True, | 32 | validation_key = models.CharField(max_length=32, null=True, |
29 | - default=lambda: uuid4().hex) | 33 | + default=get_validation_key) |
30 | created = models.DateTimeField(auto_now_add=True) | 34 | created = models.DateTimeField(auto_now_add=True) |
31 | 35 | ||
32 | class Meta: | 36 | class Meta: |