From e5fd92b4d705f7c2cf4f92c8be8f08c0b5f03e67 Mon Sep 17 00:00:00 2001 From: Chad Whitacre Date: Thu, 9 Feb 2017 07:38:46 -0500 Subject: [PATCH] Add switch to force MassPay postback --- bin/masspay.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/masspay.py b/bin/masspay.py index 7713636a68..3b7b403a2c 100755 --- a/bin/masspay.py +++ b/bin/masspay.py @@ -181,7 +181,7 @@ def load_statuses(): return statuses -def post_back_to_gratipay(): +def post_back_to_gratipay(force=False): try: gratipay_api_key = os.environ['GRATIPAY_API_KEY'] @@ -194,8 +194,9 @@ def post_back_to_gratipay(): gratipay_base_url = 'https://gratipay.com' nmasspays = int(requests.get(gratipay_base_url + '/dashboard/nmasspays').text()) - if nmasspays < 10: - print("It looks like we didn't run MassPay last week! Bailing ...") + if nmasspays < 10 and not force: + print("It looks like we didn't run MassPay last week! If you are absolutely sure that we " + "did, then rerun with -f.") return statuses = load_statuses() @@ -271,7 +272,7 @@ def main(): elif '-o' in sys.argv: compute_output_csvs() elif '-p' in sys.argv: - post_back_to_gratipay() + post_back_to_gratipay('-f' in sys.argv) if __name__ == '__main__':