Force le choix d'une école
This commit is contained in:
parent
b9ea7fba54
commit
1dd12ed438
2 changed files with 20 additions and 1 deletions
19
users/migrations/0005_auto_20180301_1029.py
Normal file
19
users/migrations/0005_auto_20180301_1029.py
Normal 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'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue