Skip to content

Commit

Permalink
Merge pull request #303 from ropable/master
Browse files Browse the repository at this point in the history
Refactor EmailedReferral.harvest() to capture 'additional documents' emails
  • Loading branch information
ropable authored Feb 16, 2024
2 parents 8b31ee8 + c0b9e41 commit c66687b
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 113 deletions.
2 changes: 1 addition & 1 deletion kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ patches:
- path: geoserver_service_patch.yaml
images:
- name: ghcr.io/dbca-wa/prs
newTag: 2.5.38
newTag: 2.5.39
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions prs2/harvester/management/commands/harvest_email_referrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ def add_arguments(self, parser):
def handle(self, *args, **options):
logger = logging.getLogger("harvester")
actions = []

# Download unread emails from each specifed source email address.
for email in settings.PLANNING_EMAILS:
if "purge_email" in options and options["purge_email"]:
actions += harvest_unread_emails(from_email=email, purge_email=True)
else:
actions += harvest_unread_emails(from_email=email)

# Import all harvested, unprocessed referrals.
actions += import_harvested_refs()

# Optionally email the power users group a report.
if options["email"]:
# Send an email to users in the "PRS power users" group.
pu_group = Group.objects.get(name=settings.PRS_POWER_USER_GROUP)
Expand Down
Loading

0 comments on commit c66687b

Please sign in to comment.