def handle(self, *args, **options): if settings.DEBUG: print("not active in non prod environments") return failed_contribs = Contribution.objects.exclude(validator_passed=True) for failed_contrib in failed_contribs: grant_txn_failed(failed_contrib)
def response_change(self, request, obj): if "_notify_contribution_failure" in request.POST: from marketing.mails import grant_txn_failed grant_txn_failed(obj) obj.validator_comment += f"User Notified {timezone.now()}" obj.save() self.message_user(request, "notified user of failure") if "_update_tx_status" in request.POST: obj.update_tx_status() obj.save() self.message_user(request, "tx status pulled from alethio/rpc nodes") return redirect(obj.admin_url)