summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-09-26 01:10:50 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-09-26 01:10:50 +0300
commitd4cf76da40c9023be0cdae536c8cbd4f78fdd8a2 (patch)
tree9dcfa1bbd7581848d4ffec5a2f9c2bfffbb46043 /core
parentf10db6d73d968d3d7dbbfa64f5815fd556b85e1b (diff)
downloadtroggle-d4cf76da40c9023be0cdae536c8cbd4f78fdd8a2.tar.gz
troggle-d4cf76da40c9023be0cdae536c8cbd4f78fdd8a2.tar.bz2
troggle-d4cf76da40c9023be0cdae536c8cbd4f78fdd8a2.zip
slightly cleaning up slug/areacode/unofficial_number mess
Diffstat (limited to 'core')
-rw-r--r--core/models/caves.py5
-rw-r--r--core/views/caves.py4
-rw-r--r--core/views/scans.py2
3 files changed, 7 insertions, 4 deletions
diff --git a/core/models/caves.py b/core/models/caves.py
index 949c089..cc5dcac 100644
--- a/core/models/caves.py
+++ b/core/models/caves.py
@@ -113,8 +113,9 @@ class Cave(TroggleModel):
else:
return self.unofficial_number
- def reference(self): # tidy this up, no longer used?
- return f"{self.areacode}-{self.number()}"
+ # def reference(self): # tidy this up, no longer used?
+ # REMOVE because of confusion with cave.references which is different
+ # return f"{self.areacode}-{self.number()}"
def get_absolute_url(self):
if self.kataster_number:
diff --git a/core/views/caves.py b/core/views/caves.py
index 5196bce..8adf0d6 100644
--- a/core/views/caves.py
+++ b/core/views/caves.py
@@ -374,7 +374,9 @@ def edit_cave(request, path="", slug=None):
cave.save()
form.save_m2m()
if slug is None:
- cs = CaveSlug(cave=cave, slug=cave.reference(), primary=True)
+ # it is not visible on the form so it always will be None
+ slug = f"{cave.areacode}-{cave.number()}"
+ cs = CaveSlug(cave=cave, slug=slug, primary=True)
cs.save()
#ceinsts = ceFormSet.save(commit=False)
#for ceinst in ceinsts:
diff --git a/core/views/scans.py b/core/views/scans.py
index a0e0446..428f8cf 100644
--- a/core/views/scans.py
+++ b/core/views/scans.py
@@ -104,7 +104,7 @@ def is_cave(wallet, id):
print(f" - Wallet {wallet} Failed to find cave object from id <{id}>")
if id.lower() != "unknown" and id != "":
print(f" - adding <{id}> to pendingcaves.txt list")
- add_cave_to_pending_list(id, f"Wallet {wallet} - Could not find id <{id}>")
+ add_cave_to_pending_list(id, wallet, f"Wallet {wallet} - Could not find id <{id}>")
return False
def fillblankothers(w):