From f2bf227ce040094b4d88322a9e051f18d15205ca Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sat, 10 Oct 2020 12:06:10 -0500 Subject: [PATCH] Allow primary location to be blank --- .../migrations/0007_auto_20201010_1702.py | 19 +++++++++++++++++++ GeoffreyApp/models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 GeoffreyApp/migrations/0007_auto_20201010_1702.py diff --git a/GeoffreyApp/migrations/0007_auto_20201010_1702.py b/GeoffreyApp/migrations/0007_auto_20201010_1702.py new file mode 100644 index 0000000..2772377 --- /dev/null +++ b/GeoffreyApp/migrations/0007_auto_20201010_1702.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1 on 2020-10-10 17:02 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('GeoffreyApp', '0006_player_primary_location'), + ] + + operations = [ + migrations.AlterField( + model_name='player', + name='primary_location', + field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='GeoffreyApp.location'), + ), + ] diff --git a/GeoffreyApp/models.py b/GeoffreyApp/models.py index f046d81..9d72c59 100644 --- a/GeoffreyApp/models.py +++ b/GeoffreyApp/models.py @@ -83,7 +83,7 @@ class Player(models.Model): Discord UUID """ - primary_location = models.OneToOneField("Location", on_delete=models.DO_NOTHING, null=True) + primary_location = models.OneToOneField("Location", on_delete=models.DO_NOTHING, blank=True, null=True) """ User's primary location """