Allow team records in the database without a country_id to support personal teams where the owner doesn't have a country set. City will still be required via forms when being created by a user
This commit is contained in:
parent
65f795fa27
commit
30083d573c
2 changed files with 20 additions and 1 deletions
19
events/migrations/0042_allow_team_without_country.py
Normal file
19
events/migrations/0042_allow_team_without_country.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 2.0 on 2018-08-19 17:22
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('events', '0041_add_private_personal_team_types'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='team',
|
||||||
|
name='country',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='events.Country'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -345,7 +345,7 @@ class Team(models.Model):
|
||||||
|
|
||||||
about_page = models.TextField(blank=True, null=True)
|
about_page = models.TextField(blank=True, null=True)
|
||||||
|
|
||||||
country = models.ForeignKey(Country, on_delete=models.CASCADE)
|
country = models.ForeignKey(Country, null=True, blank=True, on_delete=models.CASCADE)
|
||||||
spr = models.ForeignKey(SPR, null=True, blank=True, on_delete=models.CASCADE)
|
spr = models.ForeignKey(SPR, null=True, blank=True, on_delete=models.CASCADE)
|
||||||
city = models.ForeignKey(City, null=True, blank=True, on_delete=models.CASCADE)
|
city = models.ForeignKey(City, null=True, blank=True, on_delete=models.CASCADE)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue