Force le choix d'une école

This commit is contained in:
Klafyvel 2018-03-01 11:30:57 +01:00
parent b9ea7fba54
commit 1dd12ed438
2 changed files with 20 additions and 1 deletions

View file

@ -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'),
),
]

View file

@ -58,7 +58,7 @@ def update_permissions_school(sender, instance, **kwargs):
class UserProfile(models.Model): class UserProfile(models.Model):
"""Profil d'un utilisateur""" """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) user = models.OneToOneField(User, on_delete=models.CASCADE)