forked from expo/troggle
bugfix for missing dates
This commit is contained in:
parent
0ab3a4ff44
commit
ddfc677a1e
@ -593,23 +593,29 @@ def scanupload(request, path=None):
|
||||
waldata["description url"]=""
|
||||
|
||||
# find trips and survex files of the same date
|
||||
datestr = waldata["date"].replace('.','-')
|
||||
try:
|
||||
samedate = datetime.date.fromisoformat(datestr)
|
||||
except ValueError:
|
||||
# probably a single digit day number. HACKUS MAXIMUS.
|
||||
# clearly we need to fix this when we first import date strings..
|
||||
datestr = datestr[:-1] + '0' + datestr[-1]
|
||||
print(f' - {datestr=} ')
|
||||
samedate = datetime.date.fromisoformat(datestr)
|
||||
if waldata["date"]:
|
||||
datestr = waldata["date"].replace('.','-')
|
||||
try:
|
||||
samedate = datetime.date.fromisoformat(datestr)
|
||||
except ValueError:
|
||||
# probably a single digit day number. HACKUS MAXIMUS.
|
||||
# clearly we need to fix this when we first import date strings..
|
||||
datestr = datestr[:-1] + '0' + datestr[-1]
|
||||
print(f' - {datestr=} ')
|
||||
samedate = datetime.date.fromisoformat(datestr)
|
||||
|
||||
thisexpo = Expedition.objects.get(year=int(year))
|
||||
expeditionday = thisexpo.get_expedition_day(samedate)
|
||||
#print(f' - {thisexpo=} {expeditionday=}')
|
||||
svxothers = SurvexBlock.objects.filter(expeditionday=expeditionday)
|
||||
#print(f' - {thisexpo=} {expeditionday=} {svxothers=}')
|
||||
trips = LogbookEntry.objects.filter(date=samedate)
|
||||
|
||||
else:
|
||||
svxothers = None
|
||||
trips = None
|
||||
|
||||
trips = LogbookEntry.objects.filter(date=samedate)
|
||||
thisexpo = Expedition.objects.get(year=int(year))
|
||||
expeditionday = thisexpo.get_expedition_day(samedate)
|
||||
#print(f' - {thisexpo=} {expeditionday=}')
|
||||
svxothers = SurvexBlock.objects.filter(expeditionday=expeditionday)
|
||||
#print(f' - {thisexpo=} {expeditionday=} {svxothers=}')
|
||||
|
||||
|
||||
#Survex and survex complaints, comes from json file on disc, not as pre-populated as above
|
||||
complaints, caveobject = get_complaints([], waldata, svxfiles, files, wallet, wurl)
|
||||
# print(f' - {caveobject=}')
|
||||
|
Loading…
Reference in New Issue
Block a user