electronic surveys still need notes

This commit is contained in:
Philip Sargent 2023-07-29 18:21:07 +03:00
parent af6081e406
commit 5f07f234ef
2 changed files with 45 additions and 42 deletions

View File

@ -213,6 +213,7 @@ class Wallet(models.Model):
def get_ticks(self): def get_ticks(self):
"""Reads all the JSON data and sets the colour of the completion tick for each condition""" """Reads all the JSON data and sets the colour of the completion tick for each condition"""
ticks = {} ticks = {}
waldata = self.get_json() waldata = self.get_json()
if not waldata: if not waldata:
ticks["S"] = "darkgrey" ticks["S"] = "darkgrey"
@ -279,14 +280,8 @@ class Wallet(models.Model):
if 'notes not required' not in waldata: if 'notes not required' not in waldata:
waldata['notes not required'] = False waldata['notes not required'] = False
# Notes, Plan, Elevation; Tunnel
if waldata["electronic survey"]:
ticks["N"] = "green"
ticks["P"] = "green"
ticks["E"] = "green"
ticks["T"] = "green"
else:
# Notes, Plan, Elevation
files = self.get_fnames() files = self.get_fnames()
# Notes required # Notes required
@ -318,6 +313,13 @@ class Wallet(models.Model):
else: else:
ticks["E"] = "green" ticks["E"] = "green"
# if electronic, don't require P or E
if waldata["electronic survey"]:
# ticks["N"] = "green"
ticks["P"] = "green"
ticks["E"] = "green"
# ticks["T"] = "green" # No, this does not mean it has been 'tunneled' properly
# Tunnel / Therion # Tunnel / Therion
if elev_drawing_required or plan_drawing_required: if elev_drawing_required or plan_drawing_required:
ticks["T"] = "red" ticks["T"] = "red"
@ -330,6 +332,7 @@ class Wallet(models.Model):
else: else:
ticks["W"] = "red" ticks["W"] = "red"
return ticks return ticks
def __str__(self): def __str__(self):

View File

@ -190,7 +190,7 @@ def get_complaints(complaints, waldata, svxfiles, files, wallet, wurl):
# Notes required # Notes required
if ticks["N"] != "green": if ticks["N"] != "green":
complaints.append( complaints.append(
"The notes needs scanning (or renaming) or tick 'Notes not required' checkbox. No noteNN.jpg or XXnote.jpg file was found; this is not an electronic survey." "The notes needs scanning (or renaming) or tick 'Notes not required' checkbox. No noteNN.jpg or XXnote.jpg file was found. Needed even for an electronic survey."
) )
# Plan drawing required # Plan drawing required
@ -208,7 +208,7 @@ def get_complaints(complaints, waldata, svxfiles, files, wallet, wurl):
# Therion # Therion
if ticks["T"] != "green": if ticks["T"] != "green":
complaints.append( complaints.append(
"Tunnel or Therion drawing files need drawing. Or if this an electronic survey, please tick the 'Electronic survey' checkbox." "Tunnel or Therion drawing files need drawing, or tick 'Plan/Elev drawn' checkbox or 'Plan/Elev not required' checkboxes"
) )
# Description # Description