Skip to content

Commit b886db0

Browse files
committed
prevent nullable for SpeciesRange.source_feature_id field
1 parent 6db3150 commit b886db0

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

bats_ai/core/management/commands/load_species_geojson.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from django.conf import settings
1515

16-
DEFAULT_GEOJSON = settings.BASE_DIR / "bats_ai / "data" / "species.geojson"
16+
DEFAULT_GEOJSON = settings.BASE_DIR / "bats_ai/data/species.geojson"
1717

1818

1919
class Command(BaseCommand):
@@ -101,7 +101,7 @@ def handle(self, *args, **options):
101101
continue
102102

103103
fid = props.get("id")
104-
source_feature_id = str(fid) if fid is not None else None
104+
source_feature_id = str(fid) if fid is not None else ""
105105

106106
SpeciesRange.objects.update_or_create(
107107
species=species,

bats_ai/core/migrations/0036_rename_grts_cell_recording_sample_frame_id_and_more.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Generated by Django 6.0.3 on 2026-04-02 17:19
1+
# Generated by Django 6.0.3 on 2026-04-08 13:29
22
from __future__ import annotations
33

44
import django.contrib.gis.db.models.fields
@@ -33,7 +33,6 @@ class Migration(migrations.Migration):
3333
blank=True,
3434
help_text="Optional id from the source GeoJSON feature properties.",
3535
max_length=255,
36-
null=True,
3736
),
3837
),
3938
(

bats_ai/core/models/species_range.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ class SpeciesRange(models.Model):
1515
source_feature_id = models.CharField(
1616
max_length=255,
1717
blank=True,
18-
null=True,
1918
help_text="Optional id from the source GeoJSON feature properties.",
2019
)

0 commit comments

Comments
 (0)