From 2215464cfa0ce1fd3f530a43eb3ef30cd7393d29 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 8 Nov 2023 02:12:37 +0200 Subject: fix error on first creating new ent --- core/models/caves.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/models/caves.py') diff --git a/core/models/caves.py b/core/models/caves.py index 1c9eaf7..fe22ea8 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -237,14 +237,14 @@ class Entrance(TroggleModel): entrance_description = models.TextField(blank=True, null=True) explorers = models.TextField(blank=True, null=True) filename = models.CharField(max_length=200) - findability = models.CharField(max_length=1, choices=FINDABLE_CHOICES, blank=True, null=True) + findability = models.CharField(max_length=1, choices=FINDABLE_CHOICES, blank=True, null=True, default="?") findability_description = models.TextField(blank=True, null=True) lastvisit = models.TextField(blank=True, null=True) lat_wgs84 = models.TextField(blank=True, null=True) # manually entered not calculated location_description = models.TextField(blank=True, null=True) long_wgs84 = models.TextField(blank=True, null=True) # manually entered not calculated map_description = models.TextField(blank=True, null=True) - marking = models.CharField(max_length=2, choices=MARKING_CHOICES) + marking = models.CharField(max_length=2, choices=MARKING_CHOICES, default="?") marking_comment = models.TextField(blank=True, null=True) name = models.CharField(max_length=100, blank=True, null=True) other_description = models.TextField(blank=True, null=True) @@ -386,7 +386,7 @@ class Entrance(TroggleModel): if not self.filename: self.filename = self.slug + ".html" self.save() - filepath = Path(os.path.join(settings.ENTRANCEDESCRIPTIONS, self.filename)) + filepath = self.get_file_path() t = loader.get_template("dataformat/entrance.xml") now = datetime.now(timezone.utc) -- cgit v1.2.3