2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 07:47:13 +00:00

more dead chicken waving

This commit is contained in:
Philip Sargent
2022-07-21 21:52:10 +03:00
parent f46942fadf
commit 796dbf1438
3 changed files with 7 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ class Area(TroggleModel):
short_name = models.CharField(max_length=100)
name = models.CharField(max_length=200, blank=True, null=True)
description = models.TextField(blank=True, null=True)
parent = models.ForeignKey('Area', blank=True, null=True, on_delete=models.SET_NULL)
super = models.ForeignKey('Area', blank=True, null=True, on_delete=models.SET_NULL)
def __str__(self):
if self.parent:
@@ -231,9 +231,9 @@ class Cave(TroggleModel):
areas = self.area.all()
lowestareas = list(areas)
for area in areas:
if area.parent in areas:
if area.super in areas:
try:
lowestareas.remove(area.parent)
lowestareas.remove(area.super)
except:
pass
return lowestareas[0]