diff --git a/partners/migrations/0019_auto_20170624_2003.py b/partners/migrations/0019_auto_20170624_2003.py new file mode 100644 index 0000000000000000000000000000000000000000..60b6f60c561b3223abee03878709c60bf83d20af --- /dev/null +++ b/partners/migrations/0019_auto_20170624_2003.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.3 on 2017-06-24 18:03 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('partners', '0018_merge_20170624_1943'), + ] + + operations = [ + migrations.AlterField( + model_name='membershipagreement', + name='offered_yearly_contribution', + field=models.SmallIntegerField(default=0, help_text="Yearly contribution in euro's (€)"), + ), + ] diff --git a/scipost/migrations/0058_auto_20170624_2003.py b/scipost/migrations/0058_auto_20170624_2003.py new file mode 100644 index 0000000000000000000000000000000000000000..cbd739d2d53765a419f67473fe8c9da61b4e00d5 --- /dev/null +++ b/scipost/migrations/0058_auto_20170624_2003.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.3 on 2017-06-24 18:03 +from __future__ import unicode_literals + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('scipost', '0057_merge_20170624_1943'), + ] + + operations = [ + migrations.AlterField( + model_name='contributor', + name='user', + field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/scipost/models.py b/scipost/models.py index 8c477ff6b07f1aea1fa6b5628f7bb7f9066e3636..c8f96827a0aa1b6397076364705840e87ce51cde 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -37,7 +37,7 @@ class Contributor(models.Model): Permissions determine the sub-types. username, password, email, first_name and last_name are inherited from User. """ - user = models.OneToOneField(User, on_delete=models.CASCADE, unique=True) + user = models.OneToOneField(User, on_delete=models.PROTECT, unique=True) invitation_key = models.CharField(max_length=40, blank=True) activation_key = models.CharField(max_length=40, blank=True) key_expires = models.DateTimeField(default=timezone.now)