Remove unneeded Class ExpeditionDay

This commit is contained in:
2023-01-30 16:42:56 +00:00
parent ebe86d73d4
commit a12f666e96
6 changed files with 20 additions and 67 deletions

View File

@@ -212,15 +212,9 @@ def tidy_tid(tid, title):
return tid
def store_entry_into_database(date, place, tripcave, title, text, trippersons, author, expedition, logtime_underground, tid):
"""saves a single logbook entry and related personlogentrys
Does NOT save the expeditionday_id - all NULLs. why? Because we are deprecating expeditionday !
"""saves a single logbook entry and related personlogentry items
"""
# gets the current ExpeditionDay, and saves it as an object attached to
# the expedition, but does not attach it to the logbook entry. Why ?
# expedition.get_expedition_day(date)
nonLookupAttribs = {
"place": place,
"text": text,

View File

@@ -117,7 +117,6 @@ def put_person_on_trip(survexblock, personexpedition, tm):
personrole = SurvexPersonRole.objects.create(
survexblock=survexblock,
person = personexpedition.person,
# expeditionday = survexblock.expeditionday,
personexpedition=personexpedition,
personname=tm
)
@@ -497,7 +496,6 @@ class LoadingSurvex:
expo = self.get_expo_from_year(year)
survexblock.expedition = expo
# survexblock.expeditionday = expo.get_expedition_day(survexblock.date)
survexblock.save()
team = get_team_on_trip(survexblock) # should be empty, should only be in 'pending'
@@ -526,44 +524,11 @@ class LoadingSurvex:
message=message,
url=None, sb=(survexblock.survexfile.path),
)
# All this next section should not happen unless there are >1 *date lines in a block
# for pr in team: # pr is a PersonRole object
# if not pr.expeditionday: # *date and *team in 'wrong' order.
# pr.expeditionday = survexblock.expeditionday
# pr.save()
# if not pr.personexpedition:
# pe = GetPersonExpeditionNameLookup(expo).get(pr.personname.lower())
# if pe: # pe is a PersonExpedition
# # message = "! {} ({}) Fixing undated personexpedition '{}'".format(survexblock.survexfile.path, survexblock, p.personname)
# # print(self.insp+message)
# # stash_data_issue(parser='survex', message=message)
# pr.personexpedition = pe
# pr.person = pr.personexpedition.person
# pr.save()
# elif known_foreigner(pr.personname): # note, not using .lower()
# message = f"- *team {expo.year} '{pr.personname}' known foreigner on *date {survexblock.survexfile.path} ({survexblock}) in '{line}'"
# print(self.insp + message)
# # stash_data_issue(parser='survex', message=message, url=None, sb=(survexblock.survexfile.path))
# else:
# message = f"! *team {year} '{pr.personname}' FAIL personexpedition lookup on *date {survexblock.survexfile.path} ({survexblock}) '{pr.personname}'"
# print(self.insp + message)
# stash_data_issue(
# parser="survex",
# message=message,
# url=None, sb=(survexblock.survexfile.path),
# )
oline = line
if len(line) > 10:
# message = "! DATE Warning LONG DATE '{}' ({}) {}".format(oline, survexblock, survexblock.survexfile.path)
# print(self.insp+message)
# stash_data_issue(parser='survex', message=message, url=None, sb=(survexblock.survexfile.path))
message = "! DATE Warning LONG DATE '{}' ({}) {}".format(oline, survexblock, survexblock.survexfile.path)
print(self.insp+message)
stash_data_issue(parser='survex', message=message, url=None, sb=(survexblock.survexfile.path))
if line[10] == "-": # ie a range, just look at first date
line = line[0:10]
if len(line) == 10: