fixing cyclic import problem

This commit is contained in:
2023-01-29 21:45:51 +00:00
parent 226cbb6b5c
commit 89d0e1723e
7 changed files with 23 additions and 21 deletions

View File

@@ -17,6 +17,7 @@ import troggle.settings as settings
from troggle.core.models.logbooks import LogbookEntry, PersonTrip
from troggle.core.models.survex import SurvexBlock
from troggle.core.models.troggle import Expedition, Person, PersonExpedition
from troggle.core.models.wallets import Wallet
from troggle.core.utils import TROG
from troggle.parsers.imports import import_logbook
from troggle.parsers.people import GetPersonExpeditionNameLookup
@@ -206,13 +207,13 @@ def logbookentry(request, date, slug):
jwallets = allwallets.filter(walletdate=date)
for j in jwallets:
wallets.add(j)
thisexpo = this_expedition = Expedition.objects.get(year=int(date[0:4]))
if thisexpo:
expeditionday = thisexpo.get_expedition_day(date)
svxothers = SurvexBlock.objects.filter(expeditionday=expeditionday)
else:
svxothers = None
# thisexpo = Expedition.objects.get(year=int(date[0:4]))
# if thisexpo:
# #expeditionday = thisexpo.get_expedition_day(date)
# svxothers = SurvexBlock.objects.filter(date=date)
# else:
# svxothers = None
svxothers = SurvexBlock.objects.filter(date=date)
this_logbookentry=this_logbookentry[0]
# This is the only page that uses presontrip_next and persontrip_prev
# and it is calculated on the fly in the model