From 1dd12ed4383c19bacfc7fdd31793a186e7bbfcbb Mon Sep 17 00:00:00 2001 From: Klafyvel Date: Thu, 1 Mar 2018 11:30:57 +0100 Subject: [PATCH] =?UTF-8?q?Force=20le=20choix=20d'une=20=C3=A9cole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- users/migrations/0005_auto_20180301_1029.py | 19 +++++++++++++++++++ users/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 users/migrations/0005_auto_20180301_1029.py diff --git a/users/migrations/0005_auto_20180301_1029.py b/users/migrations/0005_auto_20180301_1029.py new file mode 100644 index 0000000..7b1b802 --- /dev/null +++ b/users/migrations/0005_auto_20180301_1029.py @@ -0,0 +1,19 @@ +# Generated by Django 2.0.1 on 2018-03-01 10:29 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0004_auto_20180301_0952'), + ] + + operations = [ + migrations.AlterField( + model_name='userprofile', + name='school', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.SchoolProfile'), + ), + ] diff --git a/users/models.py b/users/models.py index ec56f4c..28bead3 100644 --- a/users/models.py +++ b/users/models.py @@ -58,7 +58,7 @@ def update_permissions_school(sender, instance, **kwargs): class UserProfile(models.Model): """Profil d'un utilisateur""" - school = models.ForeignKey(SchoolProfile, on_delete=models.SET_NULL, null=True, blank=True) + school = models.ForeignKey(SchoolProfile, on_delete=models.SET_NULL, null=True) user = models.OneToOneField(User, on_delete=models.CASCADE)