From d127d935a73d47bd54015ab01250af02564c66a1 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Tue, 24 Oct 2023 16:10:36 -0700 Subject: [PATCH] Fix allow blank on order geolocation --- ...er_order_latitude_alter_order_longitude.py | 41 +++++++++++++++++++ api/models/order.py | 4 +- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 api/migrations/0045_alter_order_latitude_alter_order_longitude.py diff --git a/api/migrations/0045_alter_order_latitude_alter_order_longitude.py b/api/migrations/0045_alter_order_latitude_alter_order_longitude.py new file mode 100644 index 00000000..db1bb186 --- /dev/null +++ b/api/migrations/0045_alter_order_latitude_alter_order_longitude.py @@ -0,0 +1,41 @@ +# Generated by Django 4.2.6 on 2023-10-24 23:09 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("api", "0044_alter_markettick_fee_and_more"), + ] + + operations = [ + migrations.AlterField( + model_name="order", + name="latitude", + field=models.DecimalField( + blank=True, + decimal_places=6, + max_digits=8, + null=True, + validators=[ + django.core.validators.MinValueValidator(-90), + django.core.validators.MaxValueValidator(90), + ], + ), + ), + migrations.AlterField( + model_name="order", + name="longitude", + field=models.DecimalField( + blank=True, + decimal_places=6, + max_digits=9, + null=True, + validators=[ + django.core.validators.MinValueValidator(-180), + django.core.validators.MaxValueValidator(180), + ], + ), + ), + ] diff --git a/api/models/order.py b/api/models/order.py index 612024b9..14762134 100644 --- a/api/models/order.py +++ b/api/models/order.py @@ -136,7 +136,7 @@ class Order(models.Model): MinValueValidator(-90), MaxValueValidator(90), ], - blank=False, + blank=True, ) longitude = models.DecimalField( max_digits=9, @@ -146,7 +146,7 @@ class Order(models.Model): MinValueValidator(-180), MaxValueValidator(180), ], - blank=False, + blank=True, ) # how many sats at creation and at last check (relevant for marked to market)