Skip to content

Commit

Permalink
add arg to update payment
Browse files Browse the repository at this point in the history
  • Loading branch information
calellowitz committed Dec 6, 2024
1 parent 5b48ce1 commit 8314a3a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ def add_arguments(self, parser):
parser.add_argument(
"--include-over-limit", action="store_true", help="Also run auto-approval logic on over limit works"
)
parser.add_argument("--update-payment", action="store_true", help="Update payment accrued")

def handle(self, *args, opp: int, **options):
include_over_limit = options.get("include_over_limit", False)
update_payment = options.get("update_payment", False)
excluded = [CompletedWorkStatus.rejected]
if not include_over_limit:
excluded.append(CompletedWorkStatus.over_limit)
Expand All @@ -30,7 +32,7 @@ def handle(self, *args, opp: int, **options):
)
for access in access_objects:
completed_works = access.completedwork_set.exclude(status__in=excluded)
update_status(completed_works, access, False)
update_status(completed_works, access, update_payment)

self.stdout.write(self.style.SUCCESS(f"Successfully processed opportunity with id {opp}"))

Expand Down

0 comments on commit 8314a3a

Please sign in to comment.