From 4e021f8f53b7a4aae155619aa4c73e68415fc566 Mon Sep 17 00:00:00 2001 From: Drew Hubl Date: Fri, 17 Mar 2017 16:45:06 -0600 Subject: [PATCH] Use Django's built-in EmailField --- .../migrations/0004_use_djangos_emailfield.py | 20 +++++++++++++++++++ email_extras/models.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 email_extras/migrations/0004_use_djangos_emailfield.py diff --git a/email_extras/migrations/0004_use_djangos_emailfield.py b/email_extras/migrations/0004_use_djangos_emailfield.py new file mode 100644 index 0000000..ca85ee9 --- /dev/null +++ b/email_extras/migrations/0004_use_djangos_emailfield.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-03-17 22:35 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('email_extras', '0003_auto_20161103_0315'), + ] + + operations = [ + migrations.AlterField( + model_name='address', + name='address', + field=models.EmailField(blank=True, max_length=254), + ), + ] diff --git a/email_extras/models.py b/email_extras/models.py index 665c4bc..e4b598f 100644 --- a/email_extras/models.py +++ b/email_extras/models.py @@ -63,7 +63,7 @@ class Meta: verbose_name = _("Address") verbose_name_plural = _("Addresses") - address = models.CharField(max_length=200, default='') + address = models.EmailField(blank=True) key = models.ForeignKey('email_extras.Key', null=True, editable=False) use_asc = models.BooleanField(default=False, editable=False)