Skip to content

Commit

Permalink
fixup! improved automatic points adding script
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Jul 30, 2024
1 parent 7050922 commit 08da73b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions crowdsourcer/management/commands/add_automatic_points.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,19 +349,19 @@ def handle(
response_opts["page_number"] = prev_response.page_number
response_opts["evidence"] = prev_response.evidence

if pd.isna(point["evidence notes"]) is not False:
if pd.isna(point["evidence notes"]) is False:
response_opts["public_notes"] = point[
"evidence notes"
]
else:
if pd.isna(point["page no"]) is not False:
if pd.isna(point["page no"]) is False:
response_opts["page_number"] = point["page no"]
if pd.isna(point["evidence link"]) is not False:
response_opts["evidence"] = point["evidence link"]
if pd.isna(point["evidence notes"]) is not False:
if pd.isna(point["evidence link"]) is False:
response_opts["public_notes"] = point[
"evidence notes"
"evidence link"
]
if pd.isna(point["evidence notes"]) is False:
response_opts["evidence"] = point["evidence notes"]
if (
pd.isna(point["private notes"]) is not False
and point["private notes"] != "n/a"
Expand Down Expand Up @@ -391,6 +391,11 @@ def handle(
response.public_notes = (
point["evidence"] + "\n" + response.public_notes
)
if copy_last_year:
response.public_notes = prev_response.public_notes
response.evidence = prev_response.evidence
response.page_number = prev_response.page_number

if commit:
response.save()

Expand Down

0 comments on commit 08da73b

Please sign in to comment.