Commit 5d565503b26f71fd8ccecd67c796812914cddbad

Authored by José L. Patiño
Committed by Claude Paroz
1 parent 2008d4b2

Migrated user_email to 254 chars

EmailField defaults to 254 chars in Django 1.8. This
migration applies that both for 1.7 and 1.8.
... ... @@ -31,7 +31,7 @@ class Migration(migrations.Migration):
31 31 verbose_name='is public')),
32 32 ('is_removed', models.BooleanField(default=False,
33 33 help_text='Check this box if the comment is inappropriate. A "This comment has been removed"'
34   - 'message will be displayed instead.',
  34 + ' message will be displayed instead.',
35 35 verbose_name='is removed')),
36 36 ('content_type', models.ForeignKey(related_name='content_type_set_for_comment',
37 37 verbose_name='content type', to='contenttypes.ContentType')),
... ...
  1 +# -*- coding: utf-8 -*-
  2 +from __future__ import unicode_literals
  3 +
  4 +from django.db import models, migrations
  5 +
  6 +
  7 +class Migration(migrations.Migration):
  8 +
  9 + dependencies = [
  10 + ('django_comments', '0001_initial'),
  11 + ]
  12 +
  13 + operations = [
  14 + migrations.AlterField(
  15 + model_name='comment',
  16 + name='user_email',
  17 + field=models.EmailField(
  18 + max_length=254, verbose_name="user's email address",
  19 + blank=True),
  20 + ),
  21 + ]
... ...
... ... @@ -59,7 +59,9 @@ class Comment(BaseCommentAbstractModel):
59 59 user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('user'),
60 60 blank=True, null=True, related_name="%(class)s_comments")
61 61 user_name = models.CharField(_("user's name"), max_length=50, blank=True)
62   - user_email = models.EmailField(_("user's email address"), blank=True)
  62 + # Explicit `max_length` to apply both to Django 1.7 and 1.8+.
  63 + user_email = models.EmailField(_("user's email address"), max_length=254,
  64 + blank=True)
63 65 user_url = models.URLField(_("user's URL"), blank=True)
64 66
65 67 comment = models.TextField(_('comment'), max_length=COMMENT_MAX_LENGTH)
... ...
Please register or login to post a comment