forked from expo/troggle
hack to stop crash
This commit is contained in:
parent
127002d736
commit
761a71930b
@ -229,7 +229,11 @@ class SurvexBlock(models.Model):
|
||||
"""This is used to set different colours for the different trips on
|
||||
the calendar view of the expedition"""
|
||||
mx = 10
|
||||
index = list(SurvexBlock.objects.filter(date=self.date)).index(self)
|
||||
try:
|
||||
index = list(SurvexBlock.objects.filter(date=self.date)).index(self)
|
||||
except:
|
||||
print(f"DayIndex: BAD BAD BAD SurvexBlock items on one day '{index}' {self}")
|
||||
index = 0
|
||||
if index not in range(0, mx):
|
||||
print(f"DayIndex: More than {mx-1} SurvexBlock items on one day '{index}' {self}")
|
||||
index = 0
|
||||
|
Loading…
Reference in New Issue
Block a user