diff --git a/symposion/speakers/migrations/0003_make_fields_optional.py b/symposion/speakers/migrations/0003_make_fields_optional.py new file mode 100644 index 00000000..a11d3128 --- /dev/null +++ b/symposion/speakers/migrations/0003_make_fields_optional.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.12 on 2017-01-20 07:40 +from __future__ import unicode_literals + +import datetime +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('symposion_speakers', '0002_speaker_twitter_username'), + ] + + operations = [ + migrations.AlterField( + model_name='speaker', + name='annotation', + field=models.TextField(blank=True, verbose_name='Annotation'), + ), + migrations.AlterField( + model_name='speaker', + name='created', + field=models.DateTimeField(default=datetime.datetime.now, editable=False, verbose_name='Created'), + ), + migrations.AlterField( + model_name='speaker', + name='invite_email', + field=models.CharField(blank=True, db_index=True, default='', max_length=200, verbose_name='Invite_email'), + ), + migrations.AlterField( + model_name='speaker', + name='invite_token', + field=models.CharField(blank=True, db_index=True, max_length=40, verbose_name='Invite token'), + ), + migrations.AlterField( + model_name='speaker', + name='user', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='speaker_profile', to=settings.AUTH_USER_MODEL, verbose_name='User'), + ), + ] diff --git a/symposion/speakers/models.py b/symposion/speakers/models.py index 6e6de9d4..3b774aa7 100644 --- a/symposion/speakers/models.py +++ b/symposion/speakers/models.py @@ -20,7 +20,7 @@ class Speaker(models.Model): (2, "Two") ] - user = models.OneToOneField(User, null=True, related_name="speaker_profile", verbose_name=_("User")) + user = models.OneToOneField(User, blank=True, null=True, related_name="speaker_profile", verbose_name=_("User")) name = models.CharField(verbose_name=_("Name"), max_length=100, help_text=_("As you would like it to appear in the" " conference program.")) @@ -35,9 +35,9 @@ class Speaker(models.Model): blank=True, help_text=_(u"Your Twitter account") ) - annotation = models.TextField(verbose_name=_("Annotation")) # staff only - invite_email = models.CharField(max_length=200, unique=True, null=True, db_index=True, verbose_name=_("Invite_email")) - invite_token = models.CharField(max_length=40, db_index=True, verbose_name=_("Invite token")) + annotation = models.TextField(blank=True, verbose_name=_("Annotation")) # staff only + invite_email = models.CharField(blank=True, default="", max_length=200, db_index=True, verbose_name=_("Invite_email")) + invite_token = models.CharField(blank=True, max_length=40, db_index=True, verbose_name=_("Invite token")) created = models.DateTimeField( default=datetime.datetime.now, editable=False, diff --git a/symposion/speakers/views.py b/symposion/speakers/views.py index f60064e0..809c806d 100644 --- a/symposion/speakers/views.py +++ b/symposion/speakers/views.py @@ -34,7 +34,7 @@ def speaker_create(request): speaker = form.save(commit=False) speaker.user = request.user if not found: - speaker.invite_email = None + speaker.invite_email = "" speaker.save() messages.success(request, _("Speaker profile created.")) return redirect("dashboard")