From cb5c0bddd83c79053262cd4a563bae3bc94af0ab Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Sat, 29 Sep 2018 12:48:50 +0200 Subject: [PATCH] Add profile field to Contributor --- .../migrations/0015_contributor_profile.py | 22 +++++++++++++++++++ scipost/models.py | 3 ++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 scipost/migrations/0015_contributor_profile.py diff --git a/scipost/migrations/0015_contributor_profile.py b/scipost/migrations/0015_contributor_profile.py new file mode 100644 index 000000000..16640f440 --- /dev/null +++ b/scipost/migrations/0015_contributor_profile.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2018-09-29 10:48 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('profiles', '0002_auto_20180916_1643'), + ('scipost', '0014_auto_20180414_2218'), + ] + + operations = [ + migrations.AddField( + model_name='contributor', + name='profile', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='profiles.Profile'), + ), + ] diff --git a/scipost/models.py b/scipost/models.py index 69cb8fbca..6e183d558 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -42,7 +42,8 @@ class Contributor(models.Model): All *science* users of SciPost are Contributors. username, password, email, first_name and last_name are inherited from User. """ - + profile = models.OneToOneField('profiles.Profile', on_delete=models.PROTECT, + null=True, blank=True) user = models.OneToOneField(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, unique=True) invitation_key = models.CharField(max_length=40, blank=True) activation_key = models.CharField(max_length=40, blank=True) -- GitLab